Skip to content

Commit

Permalink
cloudwatch: add queryMode attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-fidel-wmx committed Jun 18, 2024
1 parent d6b8866 commit e5134df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Changelog
=========

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

* Added ...
* Add `QueryMode` parameter in CloudwatchMetricsTarget

0.7.1 2024-01-12
==================
Expand Down
6 changes: 4 additions & 2 deletions grafanalib/cloudwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class CloudwatchMetricsTarget(Target):
:param hide: controls if given metric is displayed on visualization
:param datasource: Grafana datasource name
"""

alias = attr.ib(default="")
dimensions = attr.ib(factory=dict, validator=instance_of(dict))
expression = attr.ib(default="")
Expand All @@ -46,9 +47,9 @@ 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 {
"alias": self.alias,
"dimensions": self.dimensions,
Expand All @@ -64,6 +65,7 @@ def to_json_data(self):
"statistic": self.statistic,
"hide": self.hide,
"datasource": self.datasource,
"queryMode": self.queryMode,
}


Expand All @@ -88,6 +90,7 @@ class CloudwatchLogsInsightsTarget(Target):
:param hide: controls if given metric is displayed on visualization
:param datasource: Grafana datasource name
"""

expression = attr.ib(default="")
id = attr.ib(default="")
logGroupNames = attr.ib(factory=list, validator=instance_of(list))
Expand All @@ -99,7 +102,6 @@ class CloudwatchLogsInsightsTarget(Target):
datasource = attr.ib(default=None)

def to_json_data(self):

return {
"expression": self.expression,
"id": self.id,
Expand Down

0 comments on commit e5134df

Please sign in to comment.