Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudwatch: add queryMode attribute #662

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you add a documentation string for this new parameter?

Suggested change
:param datasource: Grafana datasource name
:param datasource: Grafana datasource name
:param queryMode: adnafoinsdfinsoginsoigsfoigsfog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment

: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
Loading