What per-database metrics are you interested in? How does MySQL itself make
them available?

The mysqld_exporter has collectors that are off by default, but that you
can enable. Some include per-schema (database) and per-table statistics,
but the data still comes from the server-wide information_schema and
performance_schema, so you will need access to that. The exporter does
*not* support filtering these for a specific schema though. If need be, you
can do this on the Prometheus side using metric relabel configuration.

Each collector corresponds to a set of metrics. Turning off the collector
also stops the exporter from running the underlying queries, so if you run
into a lack of permissions turning off the corresponding collector can
help. You will have to experiment and/or look at the exporter code for
details.

Alternatively, if you can formulate SQL for the metrics you want to
collect, you can use any of the generic SQL exporters to turn those into
Prometheus metrics. If your needs go beyond that, writing your own exporter
is not terribly complicated – I often find it easier to express my specific
needs in my own code than to adapt a generic solution.

Best,
Matthias

On Mon, 20 Feb 2023, 11:22 Alexandra Hilzinger, <alexandra.hilzin...@mgb.ch>
wrote:

> Hi All
>
> We have the situation that we have shared-instances, so a DB-host with
> different DBs on it from different projects.
> In our current setup we are only able to collect metrics from the whole
> instance with Prometheus.
> However, we have the case that we need to break down the data to
> individual DBs.
> Is there an option with a scraper or similar?
> I haven't really found anything on the internet.
>
> I am thankful for any advice.
>
> Kind Regards
> Alex
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/bd8c36fe-310d-4296-a13c-4b42d534ac4an%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/bd8c36fe-310d-4296-a13c-4b42d534ac4an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAMV%3D_gb3JTH3M8s_U4LsgTNDB%3DAoTo40htMWHvyaORoOYn-byw%40mail.gmail.com.

Reply via email to