Silencing metrics / Skip publishing metrics based on an environment variable #3315
-
Hi, I wanted to know if it is possible to silence metrics based on an environment variable in the same way it is possible to silence logs. Basically, I want to omit publishing metrics if the environment is not production. Ideally, that should be controllable with an env var. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @zirkelc, at the moment this is not possible. We have equivalent settings for Logger (as you pointed out), Tracer, and Idempotency - basically all the other utilities with side effects - but this feature request has never come up. I think we could either add a For consistency & ease of usage we should probably add both. This would be similar to what already happens for Tracer. This is something we should be able to add relatively quickly, even for the next release. I just would like to allow one or two days max for other maintainers to give an opinion on the name of the environment variable, since it'll be a feature that will likely be adopted by other Powertools for AWS Lambda runtimes. cc @aws-powertools/lambda-python-core, @aws-powertools/lambda-dotnet-core |
Beta Was this translation helpful? Give feedback.
-
The change has been merged in #3351 and will be included in the next release. Thank you again @zirkelc for bringing this up and for the contribution! |
Beta Was this translation helpful? Give feedback.
The change has been merged in #3351 and will be included in the next release.
Thank you again @zirkelc for bringing this up and for the contribution!