client_java icon indicating copy to clipboard operation
client_java copied to clipboard

Can we set PROMETHEUS_DISABLE_CREATED_SERIES as true using java API instead of environment variables.

Open muthuveerappan opened this issue 3 years ago • 1 comments

If we have many pods, we can't change environment variables / yamls for the same to set this variable. Is there any java api to set this PROMETHEUS_DISABLE_CREATED_SERIES

Reference

Environment variable PROMETHEUS_DISABLE_CREATED_SERIES=true for disabling _created metrics

https://github.com/prometheus/client_java/pull/791/files#diff-a3ff4db5a46bb0bba0d2bfa53335ab96214c125a51e1e3345a69f2f012f41a0d

muthuveerappan avatar Dec 14 '22 14:12 muthuveerappan

I am not sure, if this will work - System.setProperty(“PROMETHEUS_DISABLE_CREATED_SERIES”, “true”); Better to provide something like a new api - Environment.forceDisableCreatedSeries();

muthuveerappan avatar Dec 14 '22 14:12 muthuveerappan