AWS CloudWatch Metric Name Mapping
Kloudfuse renames each CloudWatch metric once, when it is ingested from a CloudWatch Metric Stream. The renamed metric is what Kloudfuse stores, so the Metrics Explorer, PromQL queries, dashboards, and alerts all use the Kloudfuse name. The original CloudWatch metric name is not kept as a label.
The same rules apply to AWS service metrics and to custom metrics that you publish to your own CloudWatch namespace.
Name Structure
A Kloudfuse CloudWatch metric name has three parts:
<namespace>_<metric name>[_<statistic suffix>]
For example, the max statistic of ReadLatency in the AWS/RDS namespace becomes aws_rds_read_latency_maximum.
The Metrics Explorer and PromQL both use this underscore form. See Metric Naming.
Namespace Rules
The CloudWatch namespace is lowercased, and every character other than a letter or digit becomes an underscore. The namespace is not split on capital letters.
| CloudWatch namespace | Kloudfuse prefix |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Metric Name Rules
Kloudfuse applies these rules to the CloudWatch metric name, in order:
-
Override. If Kloudfuse defines an explicit name for the metric, that name is used and the remaining rules are skipped. See Overrides.
-
Drop a trailing
_Count. The suffix must match exactly, including the underscore and the capitalC. -
Remove separators. Every
_,-,., and%is removed. -
Split words. An underscore is inserted between a lowercase letter and a following uppercase letter or digit.
-
Lowercase. The result is lowercased, and any remaining character other than a letter or digit, such as a space, becomes an underscore.
Because separators are removed in step 3, word boundaries come only from changes in letter case.
Base Cases
| CloudWatch metric name | Kloudfuse metric name | Rule |
|---|---|---|
|
|
Split at each lowercase-to-uppercase change. |
|
|
camelCase and PascalCase give the same result. |
|
|
Underscores are removed, so the words merge. |
|
|
No lowercase-to-uppercase change, so no split. |
|
|
Hyphens are removed. |
|
|
Dots are removed. |
|
|
|
|
|
A space becomes an underscore. |
Edge Cases
| CloudWatch metric name | Kloudfuse metric name | Why |
|---|---|---|
|
|
Consecutive capitals (an acronym) stay together with the next word. |
|
|
Writing the acronym as a word splits it. |
|
|
Same acronym rule; only |
|
|
|
|
|
AWS service metrics follow the same acronym rule. |
|
|
A digit after a lowercase letter starts a new word. |
|
|
|
|
|
|
|
|
A capital after a digit does not start a new word. |
|
|
|
|
|
The trailing |
|
|
|
|
|
|
Statistic Suffixes
The main statistic for a metric is stored under the plain name, with no suffix.
A suffixed series exists only for a statistic that Kloudfuse keeps in addition to the main one.
By default, a custom metric keeps only its sum, under the plain name.
The suffix for each statistic, shown for a custom metric OrderLatency in MyApp/Orders:
| Statistic | Series name when kept as an additional statistic |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The main statistic and the suffixed series for each AWS service metric are listed in AWS CloudWatch Metric Aggregations. To keep additional statistics for a custom metric, see Keeping Additional Statistics.
Overrides
A small set of AWS service metrics have explicit Kloudfuse names that do not follow the rules above, for example:
| Namespace | CloudWatch metric name | Kloudfuse metric name |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Overrides exist only for specific metrics in AWS/ELB, AWS/ApplicationELB, AWS/NetworkELB, AWS/ES, AWS/Firehose, AWS/Glue, AWS/Lambda, and AWS/RDS.
Every other metric, including all custom metrics and every metric in services such as AWS/ElastiCache, follows the base rules.
The tables in AWS CloudWatch Metric Aggregations show the final Kloudfuse name for each listed metric.
AWS Glue Metrics
AWS/Glue metric names use dots as separators, so for this namespace most dots become underscores instead of being removed.
For example, glue.driver.aggregate.bytesRead becomes aws_glue_glue_driver_aggregate_bytes_read.
Some dots are removed instead, joining the neighboring words.
For example, ALL. joins the word after it, so glue.ALL.jvm.heap.usage becomes aws_glue_glue_alljvm_heap_usage.
Look up the exact name of each Glue metric in the AWS/Glue table of CloudWatch Aggregations.
Naming Custom Metrics
To get readable Kloudfuse names for custom metrics, name them in CloudWatch as follows:
-
Use PascalCase or camelCase for the metric name:
OrderCountororderCountbecomesorder_count. -
Do not use underscores, hyphens, or dots to separate words in the metric name; they are removed.
-
Write acronyms as words:
HttpRequests, notHTTPRequests. -
Do not end a metric name with
_Countunless you want it dropped. -
Separate words in the namespace with
/,-,., or_:Orders-Servicebecomesorders_service, whileOrdersServicebecomesordersservice.
| Renaming an existing CloudWatch metric creates a new Kloudfuse metric. Update dashboards and alerts that use the old name. |