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: Fix apostrophes in dimension values not being escaped #87182

Merged
merged 1 commit into from
May 2, 2024

Conversation

kevinwcyu
Copy link
Contributor

What is this feature?

Escape apostrophes in dimensions values

Why do we need this feature?

Using dimension values with an ' causes a syntax error in the builder mode because we don't escape ' characters.

Who is this feature for?

[Add information on what kind of user the feature is for.]

Which issue(s) does this PR fix?:

Fixes #86547

Special notes for your reviewer:

Use the provisioned cross-account cloudwatch data source and use the following metric search queries.

Code mode query

REMOVE_EMPTY(SEARCH('Namespace="ATestNameSpace" MetricName="importanttestmetric" "someGreatDimension"="Something\'sCool"', 'Average', 60))
Screenshot 2024-05-01 at 7 39 18 AM

I checked https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage.html#cloudwatch-metrics-insights-syntaxdetails to check if we needed to escape any other characters, but it only mentions double and single quotes needing escaping.

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@kevinwcyu kevinwcyu requested a review from a team as a code owner May 1, 2024 14:43
@kevinwcyu kevinwcyu requested review from idastambuk and njvrzm and removed request for a team May 1, 2024 14:43
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.1.x milestone May 1, 2024
@kevinwcyu kevinwcyu merged commit 6851ad9 into main May 2, 2024
23 checks passed
@kevinwcyu kevinwcyu deleted the kevinwcyu/86547-dimension-value-with-apostrophe branch May 2, 2024 13:15
@kevinwcyu kevinwcyu modified the milestones: 11.1.x, 11.1.0 Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloudwatch: Unable to retrieve data on dimension values with an apostrophe in the query builder
2 participants