-
Notifications
You must be signed in to change notification settings - Fork 429
Bug: publishing a metric with 9 dimensions doesn't work #1239
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
Comments
Hey @dnlopes thanks a lot for raising this with us. I've got two questions before I try reproducing it tomorrow morning:
At a first glance we're serialising correctly and CloudWatch EMF should pick it up - CloudWatch has a limit of 10 dimensions, we add "service", hence 9+service should be fine. Thank you! |
Yes. After facing this issue I simply removed one of the dimensions and everything went back to normal.
I will bump my dependency and try again layer. Btw, the last log record I pasted is from a wrong execution, but I think you already have everything you need to try to replicate it. I will try again with the latest version of powertools later and report back. |
Just tested with the latest powertool version and still got the same issue. Publishing metrics with 9 metrics does nothing, and as soon as I comment on them out, they start appearing in CW metrics board. |
Great, thank you @dnlopes; this helps a lot. I gave a heads up to the CloudWatch team, and will try to reproduce it tomorrow with and without powertools to rule out an issue with EMF async processor in CloudWatch Logs Engine. |
Hey @dnlopes I wasn't able to reproduce it with 9 dimensions: https://github.com/heitorlessa/pt-1239 I initially suspected it was the value length of one of those dimensions but nope. I've used the exact same values as dimensions you shared. I wonder if it's one of those common issues: console cache, wrong region, viewing wrong namespace (doubt it), etc. Let me know if what I tried to reproduce is invalid, or if there's any other data you want us to try reproduce. There are only two small differences in the code:
|
@heitorlessa your sample code is only using 8 dimensions, so it will send a total of 9 dimensions in the end, right? This including the one added by Powertools itself. I copied paste your sample code and everything worked. As soon as I added one more line
the dimensions are not published. I even change the |
I noticed now that the sample code in the OP also has 8 dimensions, maybe that's the confusion here. Rephrasing for clarity: publishing a CW metric with a total of 10 dimensions doesn't seem to work (9 custom dimensions + 1 from powertools) |
Ah! Sorry I understood that 9 dimensions in total doesn't work. Let me add a dummy one, make some load, and come back with the results |
Actually, it's our bug! CloudWatch Metrics support 10 metric dimensions, however CloudWatch EMF adds 1 "hidden" dimension making the limit 9. We must change our code validation to ensure 8 custom dimensions are the max and raise an exception. My apologies for the misunderstanding - we'll publish a fix and make an emergency release by EOD. |
Great, everything makes sense now then 😅 Thanks. |
This is now released under 1.26.1 version! |
@dnlopes Alex (@am29d) is kicking off the Lambda Layer release pipeline across all AWS Commercial Regions we support - it will be version 20. We'll ping you as soon as that's available. Gave you credits in the release notes: https://github.com/awslabs/aws-lambda-powertools-python/releases/tag/v1.26.1 On the breaking change not breaking change (plus any topic), feel free to email us aws-lambda-powertools-feedback@ with your availability and timezone, and we can schedule a call to hear your feedback. We'll be working on having a regular Office Hours in the future too if you're busy in the coming weeks/months. Thank you again! <3 |
New layer for version powertools 1.26.1 released. As Heitor mentioned current layer version is 20:
|
Expected Behaviour
Publishing a CW metric with 9 dimensions should work without problems.
Current Behaviour
When trying to publish a CW metric with 9 dimensions of my own, it seems the metrics never reach CloudWatch, although I can't see errors anywhere.
Code snippet
Possible Solution
No response
Steps to Reproduce
service
dimension on its ownAWS Lambda Powertools for Python version
1.20.2
AWS Lambda function runtime
3.8
Packaging format used
PyPi
Debugging logs
The text was updated successfully, but these errors were encountered: