How to generate metrics across replicas possibly on different machines #721
Replies: 1 comment
-
Hello, I converted this to a discussion instead of an issue as it appears to be a usage question, not a bug/feature request for client_python. Prometheus will handle metrics across replicas for you by adding an That said, multiprocess mode does not work across instances in most cases. Your concerns are both valid, as pids are used to identify metrics (and could be re-used by different hosts), and |
Beta Was this translation helpful? Give feedback.
-
I'm trying to figure out if I can generate Prometheus metrics for a service I scale with multiple replicas, each running in isolation (ie. within a docker container). Is this possible?
I know I can just add multiple scrape endpoints within a metric source in Prometheus's config, but I'm unsure if this would introduce errors when multiple machines emit gauge values for the same metric. I'm assuming it might work if I follow the steps mentioned for multiprocess mode, but I had the following concerns:
PROMETHEUS_MULTIPROC_DIR
folder need to be shared across machines (ie. a mounted volume)?High level, I feel like it's a common situation to want to emit metrics from a stateless replicated web service so if there's a completely different way most people do this I'd be happy to hear.
Beta Was this translation helpful? Give feedback.
All reactions