And to add to this, for the case of managed MySQL where the sidecar is not possible, we can add multi-target exporter support.
https://prometheus.io/docs/guides/multi-target-exporter/ There's a partial implementation of this in a PR on the exporter, but the author has not responded to feedback requests. On Mon, Jan 17, 2022 at 8:35 PM Matthias Rampke <[email protected]> wrote: > This is not supported in the exporter and we have no plans to add it. Most > exporters use a different approach, which we recommend for exporters in > general. > > Deploy the expory as a sidecar alongside the MySQL instance. In > Kubernetes, this means an additional container in the MySQL pod. This > solves your problem by making each MySQL+exporter pod its own scrape target > with its own instance label. > > For most exporters, the way to think about them is not as a separate > service that somehow interacts with what it is translating for (in this > case, MySQL). Rather see the exporter as an out-of-process plugin, paired > 1:1 with each MySQL process. For the purposes of monitoring, they are one > unit, and when looking at metrics and alerts you don't need to worry > whether a piece of software supports Prometheus natively or through an > exporter. > > I hope this helps! > Matthias > > On Mon, Jan 17, 2022, 13:01 ehsan karimi <[email protected]> wrote: > >> I install the mysqld-exporter on Kubernetes and when I scrape it with >> Prometheus, the instance label will show the pod IP of the mysqld-exporter >> instance and when we saw the MySqlIsDown alert, I don't know what MySQL >> instance is for it. I wanna add a label to the exposed metrics to show the >> host of MySQL. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Prometheus Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/prometheus-developers/0a4a1c76-3436-4e92-be4d-e90e0e6cc069n%40googlegroups.com >> <https://groups.google.com/d/msgid/prometheus-developers/0a4a1c76-3436-4e92-be4d-e90e0e6cc069n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-developers/CAMV%3D_gbi7mV2UWL-n8aFAUWZY%3DVC2c3hPo8%3DfUKp7ZkefNwb2w%40mail.gmail.com > <https://groups.google.com/d/msgid/prometheus-developers/CAMV%3D_gbi7mV2UWL-n8aFAUWZY%3DVC2c3hPo8%3DfUKp7ZkefNwb2w%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Prometheus Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CABbyFmpWkurNQvmbU-BEdVUmqPrKNGqRWsvTyTVC05AeSaObHg%40mail.gmail.com.

