Skip to content

Commit

Permalink
cloudwatch: add queryMode attribute (#662)
Browse files Browse the repository at this point in the history
* cloudwatch: add queryMode attribute

* cloudwatch: add doc for queryMode

---------

Co-authored-by: JamesGibo <[email protected]>
  • Loading branch information
nicolas-fidel-wmx and JamesGibo authored Jul 16, 2024
1 parent 0b54201 commit 1385ca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Changelog
=========


x.x.x ?
=======

* Add `QueryMode` parameter in CloudwatchMetricsTarget
* Added support `alias` via the `legendFormat` option for `Target`
* Added `neutral` option for `GaugePanel` (supported by Grafana 9.3.0 - https://github.com/grafana/grafana/discussions/38273)
* Added support `alias` via the `legendFormat` option for `Target`
Expand Down
3 changes: 3 additions & 0 deletions grafanalib/cloudwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CloudwatchMetricsTarget(Target):
:param statistic: Cloudwatch mathematic statistic
:param hide: controls if given metric is displayed on visualization
:param datasource: Grafana datasource name
:param queryMode: queryMode for cloudwatch metric request
"""

alias = attr.ib(default="")
Expand All @@ -51,6 +52,7 @@ class CloudwatchMetricsTarget(Target):
statistic = attr.ib(default="Average")
hide = attr.ib(default=False, validator=instance_of(bool))
datasource = attr.ib(default=None)
queryMode = attr.ib(default="")

def to_json_data(self):
return {
Expand All @@ -70,6 +72,7 @@ def to_json_data(self):
"statistic": self.statistic,
"hide": self.hide,
"datasource": self.datasource,
"queryMode": self.queryMode,
}


Expand Down

0 comments on commit 1385ca2

Please sign in to comment.