A simple and stupid question about prometheus_client #938
-
I have a question about prometheus_client. backgroud: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can totally expose Prometheus metrics without using prometheus/client_golang. For very simple cases, that might even be the best. Like you just have one value and want to expose it. Or you have a very specific use case (https://github.com/kubernetes/kube-state-metrics is a famous example of a widely used Go program exposing Prometheus metrics without using prometheus/client_golang .) prometheus/client_golang solves a whole lot of problems for you, though: Validation, consistency, concurrency-safety, facilitates the actual instrumentation (how to get to the numbers you want to expose), and much more. Just try it out on your own, and you will quickly notice that most cases work much simpler with prometheus/client_golang than without it. |
Beta Was this translation helpful? Give feedback.
You can totally expose Prometheus metrics without using prometheus/client_golang. For very simple cases, that might even be the best. Like you just have one value and want to expose it. Or you have a very specific use case (https://github.com/kubernetes/kube-state-metrics is a famous example of a widely used Go program exposing Prometheus metrics without using prometheus/client_golang .)
prometheus/client_golang solves a whole lot of problems for you, though: Validation, consistency, concurrency-safety, facilitates the actual instrumentation (how to get to the numbers you want to expose), and much more. Just try it out on your own, and you will quickly notice that most cases work much sim…