prometheus/graphite_exporter

Setup in kubernetes cluster

vishnugs opened this issue · 4 comments

Hi

I have installed Prometheus in my k8s cluster. Howcan I setup graphite exporter in Kubernetes?

Would like to have via helm ?

The best way to use this exporter is as a sidecar (a second container in the pod). By running next to each application instance, you get Prometheus-native per-instance metrics for "free". Since this depends on how your application is deployed, I would rather not provide a generic deployment.

how can it be used as a second container ? Could you please give an example?

pat-s commented

A specific setup question:

Could the following setup work? Using the docker image from here within the kube-prometheus-stack chart? Specifically in

    ## Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to a Prometheus pod.
    ## if using proxy extraContainer update targetPort with proxy container port
    containers: []

https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L2569

It would work, but I advise against it. Instead, put it as a sidecar into each application pod that produces Graphite metrics, and configure the application to produce to localhost.

This way, the Prometheus metrics are available just like direct instrumentation: the fact that the Graphite protocol was involved at some point is entirely contained within the container. You can even ship and evolve the mapping configuration as part of each application, instead of maintaining it centrally (this may require an initContainer to copy it into a shared emptyDir volume).

Additionally, you get per-pod metrics for "free", although that is more helpful with e.g. request counts, which Graphite doesn't really support. If you are actually emitting statsd events for those, use the statsd exporter in the same way