overview dashboard: Look up services by 'service' label, not job

Job can't be repeated across scrape jobs, service can
pull/157/head
Mike Lang 5 years ago
parent ac98d67853
commit e1993c6a79

@ -32,7 +32,7 @@ local service_status_table = {
type: "table", type: "table",
targets: [ 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, intervalFactor: 1,
format: "table", format: "table",
refId: refId(i), refId: refId(i),

@ -42,6 +42,7 @@ local services = [
labels: { labels: {
instance: host, instance: host,
role: hosts[host][1], role: hosts[host][1],
service: service,
}, },
} for host in std.objectFields(hosts) } for host in std.objectFields(hosts)
], ],

Loading…
Cancel
Save