-
Notifications
You must be signed in to change notification settings - Fork 815
Add ability to turn off _created metrics #774
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 @mindw. There is a
This can be configured programmatically, and in the exporter Servlet it can also be configured via Servlet configuration. What do you think about adding
Then you could just say Would that work? It would be trivial to implement :) |
Thanks for the pointers @fstab ! Also, I would like to implement @SuperQ suggestion of making it an option of the registry. Yes, even with my feeble Java skills it should be easy implement and test. |
Currently, the
In the unlikely case that you write your own exporter, you can pass the filter as a parameter to I think this covers all cases, and a new option for the registry is not needed in We should extend the
and add this to the configuration in
That being said, if other libraries like |
@fstab thank you for your valuable inputs. While the suggested implementation you've suggested seems perfectly reasonable to me, the discussion here isn't about the implementation details. I'll try to summarize the referenced tickets above. IMHO the rational for choosing an environment variable strategy for implementation @SuperQ suggestion makes sense as it allows the exporter implementer to opt out at the registry - this is useful for exporters which re-create all of the metrics every time they are requested. Hopefully the above makes sense. |
I think there is a misunderstanding. I wrote above
This is a method of the registry. There is no need to change code of all counters. |
Adding the use of an environment variable in a client library doesn't feel like the correct approach to me. I think adding a
... and leave the configuration and management of any filters to the exporter/calling code. |
@dhoard please see my comment above:
|
@mindw Java-based exporters package a specific version of |
I created #787 so you can see how this looks like using the sample name filter. Comments welcome! |
@fstab that is an interesting approach - but IMHO it does not entirely cover the use case. IMO Using an environment variable to toggle |
As per OpenMetrics Spec it is illegal to use the
So it does not make a difference whether we remove all |
@fstab I stand corrected on the user IMHO both approaches should be implemented:
It would be also desirable to be consistent between client libraries ( For reference see prometheus/client_python#774 (comment) . |
As much as I dislike ENV var side-effect behavior, I agree with @mindw in this case. Having both is useful in this case. I personally prefer the code toggle, but as pointed out in the Python implementation, sometimes you're deploying code you can't easily control. |
Thanks for the discussion so far, I really appreciate your opinions. If we implement configuration via environment variables, we need to decide whether we should implement a specific variable for disabling Examples:
With generic name filter environment variables we could provide a mechanism to cover all these cases. For example:
My feeling is that if we can implement generic name filter variables that cover many scenarios that's better than a specific |
We only need the one feature, The other things seem to be about filtering collection of metrics, not related to generating meta-series. |
This is incorrect. It is discouraged as it may cause confusion, but it's only forbidden to cause potential clashes with other exposed metrics. |
Clone of prometheus/client_python#672
The text was updated successfully, but these errors were encountered: