Skip to content
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

Inheritance in metric_namespace and metric_subsystem #315

Open
bjb19 opened this issue Jun 5, 2024 · 3 comments
Open

Inheritance in metric_namespace and metric_subsystem #315

bjb19 opened this issue Jun 5, 2024 · 3 comments

Comments

@bjb19
Copy link

bjb19 commented Jun 5, 2024

When I set the value of metric_namespace and metric_subsystem at the instrument level it seems like this should propagate down to the metrics (Similar to the default). This does not seem to be the case when working with examples. Happy to open a PR.

@trallnag
Copy link
Owner

trallnag commented Jun 5, 2024

Hi, what "examples" do you mean? Can you give an example?

Also feel free to open PR. But note that I have low interest / low priority in this project. So it will be a few weeks until I get around to review, merge, and so on.

@glebignatieff
Copy link

glebignatieff commented Jun 11, 2024

He means that if you set up your own metrics, then assigning metric_namespace and metric_subsystem in the instrument() method has no effect. As a result, you have to specify them per metric like this:

instrumentator.add(metrics.requests(metric_namespace=METRICS_NAMESPACE))
instrumentator.add(metrics.latency(metric_namespace=METRICS_NAMESPACE))

@bjb19
Copy link
Author

bjb19 commented Jun 18, 2024

Yeah that is a correct example. Thanks for the notice. This is not a pressing issue for me as there is an easy workaround but I appreciate your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants