Should Prometheus exporters be run as sidecar containers or in separate deployments?

8/29/2019

For the general case, I'm wondering if there's a good reason - one way or the other - for running Prometheus exporters as their own Deployments vs. running as a sidecar container in the Pod.

As a concrete example, say I want to monitor an nginx application and plan to use the nginx Prometheus exporter. Should I:

A: Set up a new deployment with a single container running the nginx exporter, then provide ingress with a service.

B: Add an additional container to the nginx application Pod running the Prometheus exporter.

-- Bobby
kubernetes
prometheus

1 Answer

8/29/2019

Use exporter as a sidecar container in the main pod. We follow this approach to scrape metrics from web based Java applications

-- P Ekambaram
Source: StackOverflow