aws-powertools / powertools-lambda-dotnet

Powertools is a developer toolkit to implement Serverless best practices and increase developer velocity.
https://docs.powertools.aws.dev/lambda/dotnet/
MIT No Attribution
158 stars 25 forks source link

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

Closed leandrodamascena closed 2 months ago

leandrodamascena commented 3 months ago

Use case

Original issue: https://github.com/aws-powertools/powertools-lambda-python/issues/4834

Consider changes to the Dotnet 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: https://github.com/aws-powertools/powertools-lambda-python/issues/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

hjgraca commented 2 months ago

@leandrodamascena thanks for opening the issue. None MetricUnit is already supported in Powertools .NET.

https://github.com/aws-powertools/powertools-lambda-dotnet/blob/04cbc46a91731ebc160bb4ff5b99014d46ca5daf/libraries/src/AWS.Lambda.Powertools.Metrics/Model/MetricUnit.cs#L34

Closing the issue