简体   繁体   中英

Kubernetes - Prometheus - Is exporter really needed if pods are already discovered by prometheus?

I installed mongodb using helm and then later installed prometheus using heml. When I checked grafana, it had already discovered the mongodb pods and shows the disk space and cpu usage etc., I'm guessing it discovered using the builtin service monitor for prometheus for kube services and nodes since i don't see a addition mongodb service monitor installed by default.

These are the built in service monitors that got installed with prometheus:

prometheus-prometheus-oper-alertmanager              107m
prometheus-prometheus-oper-apiserver                 107m
prometheus-prometheus-oper-coredns                   107m
prometheus-prometheus-oper-grafana                   107m
prometheus-prometheus-oper-kube-controller-manager   107m
prometheus-prometheus-oper-kube-etcd                 107m
prometheus-prometheus-oper-kube-proxy                107m
prometheus-prometheus-oper-kube-scheduler            107m
prometheus-prometheus-oper-kube-state-metrics        107m
prometheus-prometheus-oper-kubelet                   107m
prometheus-prometheus-oper-node-exporter             107m
prometheus-prometheus-oper-operator                  107m
prometheus-prometheus-oper-prometheus                107m

In the docs they have a exporter for mongodb called mongodb-exporter-prometheus-mongodb-exporter . I installed it I don't see any difference. I still see the same pods that were detected already.

What is the need for the mongodb-exporter-prometheus-mongodb-exporter ? I thought maybe it'll show some DB insights.

I'm about to test mysql pods and I guess there is really no need for the mysql exporter either if promethues can detect them without it.

An exporter is needed if the original application(mysql, mongodb etc) are not able to expose metrics in prometheus format at /metrics endpoint or you need more metrics which is not exposed by the original application. Hence the exporter's responsibility is to expose metrics without needing the original application to be instrumented for exposing metrics.

You need to configure prometheus to be able to discover the exporter application pod using a service monitor. You get more metrics via the exporter which is not available in the original mongodb application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM