Skip to content

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

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

Closed
2 tasks done
ethantkoenig opened this issue Jul 28, 2024 · 4 comments · Fixed by #4904
Closed
2 tasks done

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

ethantkoenig opened this issue Jul 28, 2024 · 4 comments · Fixed by #4904
Assignees
Labels
feature-request feature request

Comments

@ethantkoenig
Copy link

Use case

https://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

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

@ethantkoenig ethantkoenig added feature-request feature request triage Pending triage from maintainers labels Jul 28, 2024
Copy link

boring-cyborg bot commented Jul 28, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@sthulb
Copy link
Contributor

sthulb commented Jul 30, 2024

Hi @ethantkoenig

I think we’re able to support this easily by adding a None element to the MetricUnit class/enum. I can’t see this causing any issues since it would always be used as MetricUnit.None

I was wrong, Python does indeed care about None even as a property

@sthulb sthulb removed the triage Pending triage from maintainers label Aug 2, 2024
@leandrodamascena leandrodamascena moved this from Triage to Working on it in Powertools for AWS Lambda (Python) Aug 2, 2024
@leandrodamascena leandrodamascena linked a pull request Aug 7, 2024 that will close this issue
7 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (Python) Aug 7, 2024
Copy link
Contributor

github-actions bot commented Aug 7, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Copy link
Contributor

github-actions bot commented Aug 8, 2024

This is now released under 2.43.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Aug 8, 2024
@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

2 participants