Hi,
Thank you for that answer!
I actually have 3 variables:
NameSpace:
Query: query_result(pg_exporter_last_scrape_duration_seconds)
Regexp: /.*kubernetes_namespace="([^"]+).*/
Release:
Query:
query_result(pg_exporter_last_scrape_duration_seconds{kubernetes_namespace="$namespace"})
Regex: /.*release="([^"]+)/
Instance:
Query: query_result(up{release="$release",job="postgres_exporter"})
Regex: /.*instance="([^"]+).*/
I need to add another variable to reflect different ports on the same
server(host)
In prometheus metrics it looks like this for example:
pg_settings_seq_page_cost{instance="10.97.7.97:9187",job="postgres_exporter",
*server="10.97.7.97:5009"*}
pg_settings_seq_page_cost{instance="10.97.7.97:9187",job="postgres_exporter",
*server="10.97.7.97:5020"*}
So how can I define a variable to give me a drop down list of servers with
ports, or add it to the "instance" varabiable?
Thanks,
Tamar
ב-יום ראשון, 1 בנובמבר 2020 בשעה 15:41:36 UTC+2, [email protected] כתב/ה:
> I expect it's for a drop-down menu in the dashboard.
>
> If your pg_exporter_last_scrape_duration_seconds metric doesn't have any
> label "kubernetes_namespace", then that Grafana query isn't going to find
> any values for that dropdown.
>
> But if the variable has an empty value, then any dashboard query of the
> form
> pg_whatever{kubernetes_namespace="$namespace"}
> will match all metrics with {kubernetes_namespace=""}, which is the same
> as metrics without a "kubernetes_namespace" label.
>
--
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/bdea5710-1759-4e2b-b259-1c97f59c53den%40googlegroups.com.