Skip to content

Commit 40224ba

Browse files
vohogithub-actions
andauthored
chore(docs): clarify usage of undefined in metric search [skip ci] (#227)
* chore: updated documentation about using undefined in metric search * chore: self mutation Signed-off-by: github-actions <[email protected]> Signed-off-by: github-actions <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 4a0f0d7 commit 40224ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

API.md

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/common/metric/MetricFactory.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ export class MetricFactory {
106106

107107
/**
108108
* Factory method that creates a metric search query. The metric properties will already be updated to comply with the global defaults.
109+
* If you want to match "any value" of a specific dimension, please use `undefined` value representation in your consumer language.
110+
* (For example, `undefined as any as string` in TypeScript, due to JSII typing quirks.)
109111
*
110112
* @param query metric search query (the same as the search query prompt in CloudWatch AWS Console), it might also be empty
111-
* @param dimensionsMap dimensions, further narrowing the search results; values might be undefined if you want to represent "any value"
113+
* @param dimensionsMap dimensions, further narrowing the search results; use `undefined` if you want to represent "any value" (in TS: `undefined as any as string`)
112114
* @param statistic aggregation statistic to use
113115
* @param namespace specify a custom namespace; if undefined, uses the global default
114116
* @param label specify custom label for search metrics; default is " " as it cannot be empty string

0 commit comments

Comments
 (0)