prometheus-logstash-exporter
prometheus-logstash-exporter copied to clipboard
Monitoring all logstash replicas in K8s
Hello,
Is it possible with the exporter to monitor all replicas of Logstash running in K8s? On Prometheus metrics I cannot see more than one node.
Thanks in advance
Hi @ArjonBu .
By default this exporter watching just one instance. But in K8s you can "attach" it as a sidecar to Logstash pods. Deployment looking something like this:
...
spec:
containers:
- name: logstash
(... setup for logstash ...)
- name: exporter
image: <PathToYourDockerContainerWithName>:<VersionForYourDockerContainer>
args:
- --web.listen-address=:9310 # by default is used port 9304, but feel free adapt this setting
ports:
- containerPort: 9310
name: metrics
protocol: TCP
resources:
requests:
cpu: "100m"
memory: "16M"
limits:
cpu: "200m"
memory: "32M"
...
Please, take this just a example! You need also update K8s service object and servicemonitor object for Prometheus.
Hope that helps.