Skip to content

Feature request: support metrics with unit "None" #2903

Closed
@leandrodamascena

Description

@leandrodamascena

Use case

Original issue: aws-powertools/powertools-lambda-python#4834

Consider changes to the TypeScript naming pattern in the text below.

docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html reports that "None" is a valid unit for CloudWatch metrics, but the MetricUnit enum does not have a member for this unit.

The lack of such a member means that there is no way to create metrics with unit "None" via Powertools. One cannot pass the string "None" as the unit parameter of Metric.add_metric, due to this code.

Solution/User Experience

Original issue: aws-powertools/powertools-lambda-python#4834

Of course, I realize that a MetricUnit member for "None" cannot be named None, but can a member with a different name (perhaps named None_ or NoUnit) please be added to the enum?

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedfeature-requestThis item refers to a feature request for an existing or new utilitymetricsThis item relates to the Metrics Utility

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions