Skip to content

Commit d3f1b11

Browse files
committed
Use named parameters in PromGraph call to Target
'legendFormat' has moved from the 2nd to 3rd positional parameter, so just name all the parameters to avoid hitting this again.
1 parent 556e9b6 commit d3f1b11

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
Changes
88
-------
99

10+
* Fixed a bug that was losing any legends on a PromGraph
1011
* Added the AlertList Panel support in grafanalib/core
1112
* Added the support for mixed data sources
1213

grafanalib/prometheus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def PromGraph(data_source, title, expressions, **kwargs):
2828
for (args, refId) in zip(expressions, letters)]
2929
else:
3030
targets = [
31-
G.Target(expr, legend, refId=refId)
31+
G.Target(expr=expr, legendFormat=legend, refId=refId)
3232
for ((legend, expr), refId) in zip(expressions, letters)]
3333
return G.Graph(
3434
title=title,

0 commit comments

Comments
 (0)