From e1993c6a79d5ccabee0fca77b55bd0eac547b1c3 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Fri, 8 Nov 2019 16:49:28 -0800 Subject: [PATCH] overview dashboard: Look up services by 'service' label, not job Job can't be repeated across scrape jobs, service can --- monitoring/dashboards/overview.jsonnet | 2 +- monitoring/prometheus.jsonnet | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/monitoring/dashboards/overview.jsonnet b/monitoring/dashboards/overview.jsonnet index 59b18e6..e4ba8e8 100644 --- a/monitoring/dashboards/overview.jsonnet +++ b/monitoring/dashboards/overview.jsonnet @@ -32,7 +32,7 @@ local service_status_table = { type: "table", targets: [ { - expr: 'sum(up{job="%s", role=~"%s"}) by (instance)' % [services[i], roles_for_service[services[i]]], + expr: 'sum(up{service="%s", role=~"%s"}) by (instance)' % [services[i], roles_for_service[services[i]]], intervalFactor: 1, format: "table", refId: refId(i), diff --git a/monitoring/prometheus.jsonnet b/monitoring/prometheus.jsonnet index 157a0c9..9792147 100644 --- a/monitoring/prometheus.jsonnet +++ b/monitoring/prometheus.jsonnet @@ -42,6 +42,7 @@ local services = [ labels: { instance: host, role: hosts[host][1], + service: service, }, } for host in std.objectFields(hosts) ],