Skip to content

Commit 1385ca2

Browse files
cloudwatch: add queryMode attribute (#662)
* cloudwatch: add queryMode attribute * cloudwatch: add doc for queryMode --------- Co-authored-by: JamesGibo <22477854+JamesGibo@users.noreply.github.com>
1 parent 0b54201 commit 1385ca2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Changelog
33
=========
44

5-
65
x.x.x ?
76
=======
87

8+
* Add `QueryMode` parameter in CloudwatchMetricsTarget
99
* Added support `alias` via the `legendFormat` option for `Target`
1010
* Added `neutral` option for `GaugePanel` (supported by Grafana 9.3.0 - https://github.com/grafana/grafana/discussions/38273)
1111
* Added support `alias` via the `legendFormat` option for `Target`

grafanalib/cloudwatch.py

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class CloudwatchMetricsTarget(Target):
3333
:param statistic: Cloudwatch mathematic statistic
3434
:param hide: controls if given metric is displayed on visualization
3535
:param datasource: Grafana datasource name
36+
:param queryMode: queryMode for cloudwatch metric request
3637
"""
3738

3839
alias = attr.ib(default="")
@@ -51,6 +52,7 @@ class CloudwatchMetricsTarget(Target):
5152
statistic = attr.ib(default="Average")
5253
hide = attr.ib(default=False, validator=instance_of(bool))
5354
datasource = attr.ib(default=None)
55+
queryMode = attr.ib(default="")
5456

5557
def to_json_data(self):
5658
return {
@@ -70,6 +72,7 @@ def to_json_data(self):
7072
"statistic": self.statistic,
7173
"hide": self.hide,
7274
"datasource": self.datasource,
75+
"queryMode": self.queryMode,
7376
}
7477

7578

0 commit comments

Comments
 (0)