CloudWatch: Add support for dynamic labels #43894
Replies: 5 comments
-
Just wanted to add that I think when we do this we may also want to revisit some odd behavior we have when switching between Code/Builder for Metric Search. Some context can be seen here in this closed draft: #45432 |
Beta Was this translation helpful? Give feedback.
-
Converted this to an issue: #43905 |
Beta Was this translation helpful? Give feedback.
-
A few more findings/thoughts:
It's only a few dynamic label values that are time based. Using the default timezone of Grafana should be sufficient for the first version of dynamic labels in Grafana. Migrations Breaking changes Rough estimate for implementing this feature: 40 hours |
Beta Was this translation helpful? Give feedback.
-
Implementation steps:
|
Beta Was this translation helpful? Give feedback.
-
For information we aim to get this into Grafana 9.0 #48434 |
Beta Was this translation helpful? Give feedback.
-
Currently, the cloudwatch data source supports alias formatting that allows the user to substitute the returned metric label with region, period, metric dimension name etc. This substitution is performed in the plugin backend and the code for this is complicated. Now the GetMetricData api supports dynamic labels, so instead of doing the substitution in Grafana, we should let the api handle this for us.
Even though it will be complicated, we should be able to migrate any existing alias patterns into the dynamic label pattern.
{{region}}
${PROP('Region')}
Namespace: {{namespace}}, Instance: {{InstanceId}}
Namespace: ${PROP('namespace')}, Instance: ${PROP('Dim.InstanceId')}
One problem though is that the LabelOptions which allows you to specify a time zone for the dynamic label calculations is set on request level and not on query level. Currently, there's no way for query editors to define panel level settings, but possibly the plugin api can be extended to support that. If not, even though it's not ideal we can make this a grafana configuration under the aws section.
Beta Was this translation helpful? Give feedback.
All reactions