-
Notifications
You must be signed in to change notification settings - Fork 421
single_metric() to inherit default dimensions #1859
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
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
I'll be happy to contribute to this feature. |
Hi @prudnikov thank you so much for opening this issue, it's very well written and very clear! We would be happy to merge your contribution and this feature. Kudos! |
Hi @prudnikov do you have the time to submit a PR for this issue? We would love to review it and merge it :) |
@rubenfonseca I'll try to finish this today. |
I just created a PR, I changed design a little bit, my motivation for that is described in the PR. |
|
Use case
At the root level I define default metric which is environment name in my case.
This is all fine and
Environment
gets propagated to all metrics. However, whensingle_metric()
is used this default dimension is ignored. This is what I do to overcome that.or it should be possible with
this_metric.default_dimensions = metrics.default_dimensions
, I did not tried this.This way all the default dimensions are propagated with a single metric.
Solution/User Experience
When creating a
SingleMetric
withsingle_metric
context manager default dimensions should be copied to a SingleMetric instance.I can imagine the situation when you don't want to propagate default dimensions to the SingleMetric.
To keep existing usage untouched I suppose the default behavior should be to not propagate default dimensions. So the solution can be the additional keyword argument
inherit_default_dimensions: bool = False
Alternative solutions
No response
Acknowledgment
The text was updated successfully, but these errors were encountered: