monitoring: Set instance to friendly name for each node we're monitoring

So that you get eg. "charm" instead of "IP:PORT"
pull/149/head
Mike Lang 5 years ago
parent 51adeeab19
commit 21a46a66bb

@ -1,5 +1,6 @@
local hosts = [ local hosts = {
]; // name: "host:port"
};
local services = [ local services = [
"restreamer", "restreamer",
"downloader", "downloader",
@ -16,14 +17,22 @@ local services = [
scrape_interval: "15s", scrape_interval: "15s",
}, },
scrape_configs: [ scrape_configs: [
{job_name: "prometheus", static_configs: [{targets: ["localhost:9090"]}]}, {
job_name: "prometheus",
static_configs: [
{targets: ["localhost:9090"], labels: {instance: "prometheus"}}
],
},
] + [ ] + [
{ {
job_name: service, job_name: service,
metrics_path: "/metrics/%s" % service, metrics_path: "/metrics/%s" % service,
static_configs: [{ static_configs: [
targets: hosts, {
}], targets: [hosts[host]],
labels: {instance: host},
} for host in std.objectFields(hosts)
],
} }
for service in services for service in services
], ],

Loading…
Cancel
Save