From ba3acf83bf7c221fb509ad479eedd7d933219d4d Mon Sep 17 00:00:00 2001 From: Isabella Siu Date: Thu, 4 Apr 2024 09:48:48 -0400 Subject: [PATCH] CloudWatch: Clarify match exact tooltip and docs (#85095) * CloudWatch: Clarify match exact tooltip * Update docs * fix typo * ida comment and removing a couple "you"s * present tense --- .../aws-cloudwatch/query-editor/index.md | 8 ++++---- .../MetricStatEditor/MetricStatEditor.tsx | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/sources/datasources/aws-cloudwatch/query-editor/index.md b/docs/sources/datasources/aws-cloudwatch/query-editor/index.md index 4498c8345b1..7ccfc88a5a7 100644 --- a/docs/sources/datasources/aws-cloudwatch/query-editor/index.md +++ b/docs/sources/datasources/aws-cloudwatch/query-editor/index.md @@ -29,7 +29,7 @@ For general documentation on querying data sources in Grafana, see [Query and tr The CloudWatch data source can query data from both CloudWatch metrics and CloudWatch Logs APIs, each with its own specialized query editor. -- [CloudWatch metrics](#query-cloudwatch-metrics) +- [CloudWatch Metrics](#query-cloudwatch-metrics) - [CloudWatch Logs](#query-cloudwatch-logs) {{< figure src="/static/img/docs/cloudwatch/cloudwatch-query-editor-api-modes-8.3.0.png" max-width="500px" class="docs-image--right" caption="CloudWatch API modes" >}} @@ -45,10 +45,10 @@ You can build two types of queries with the CloudWatch query editor: ### Create a Metric Search query -To create a valid Metric Search query, specify the namespace, metric name, and at least one statistic. +To create a valid Metric Search query, specify the namespace, metric name, and at least one statistic. Dimensions are optional, but for a dimension to be considered part of the query it must have both a key and a value. -If you enable `Match Exact`, you must also specify all dimensions of the metric you're querying so that the [metric schema](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html) matches exactly. -If `Match Exact` is disabled, you can specify any number of dimensions on which you'd like to filter. +If you enable `Match Exact`, you must also specify all dimensions of the metric you're querying so that the [metric schema](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html) matches exactly. With `Match Exact` enabled the query only returns metrics that have the specified dimensions and no others, so dimensions that are on the metric but that are not being filtered on must be added as a wildcard (`*`) filter. +If `Match Exact` is disabled, you can specify any number of dimensions on which you'd like to filter. With `Match Exact` disabled the query returns any metrics that match the namespace, metric name, and all defined dimensions, whether or not they have additional dimensions. The data source returns up to 100 metrics matching your filter criteria. You can also augment queries by using [template variables]({{< relref "./template-variables" >}}). diff --git a/public/app/plugins/datasource/cloudwatch/components/shared/MetricStatEditor/MetricStatEditor.tsx b/public/app/plugins/datasource/cloudwatch/components/shared/MetricStatEditor/MetricStatEditor.tsx index 1bd3035726a..237d83fccd2 100644 --- a/public/app/plugins/datasource/cloudwatch/components/shared/MetricStatEditor/MetricStatEditor.tsx +++ b/public/app/plugins/datasource/cloudwatch/components/shared/MetricStatEditor/MetricStatEditor.tsx @@ -146,7 +146,24 @@ export const MetricStatEditor = ({ + { + 'Only show metrics that contain exactly the dimensions defined in the query and match the specified values. If this is enabled, all dimensions of the metric being queried must be specified so that the ' + } + + metric schema + + { + ' matches exactly. If this is disabled, metrics that match the schema and have additional dimensions will also be returned.' + } + + } + tooltipInteractive >