Why do you not just filter it in the query at the Grafana end? That is,
why do you need to create a new metric?
Also: if you *do* need to create a new metric which is just a subset of an
existing metric, then prometheus recording rules would be better than
dropping files for the textfile collector.
On Monday, 13 November 2023 at 01:13:48 UTC+10 hyl dop wrote:
> Hi, I'd like to filter the node_systemd_unit_state metric to display only
> a few services on Grafana.
>
> So I thought of creating a new metric in a *.prom file using the
> --collector.textfile.directory option. The problem is that I don't know if
> it's possible to create a metric using an existing metric.
>
> For example, I'd like the metric I create to display the result of these
> metrics :
>
> node_systemd_unit_state{name=~"Net.service"} == 1
> node_systemd_unit_state{name=~"fedo.*"} == 1
> node_systemd_unit_state{name=~"grara.*"} == 1
>
> Thank you in advance for your reply
>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/42ac4f84-04ae-48b1-87bb-cfa7c5244826n%40googlegroups.com.