Make metrics more readable

This commit is contained in:
IamTheFij 2022-07-25 21:45:01 -07:00
parent 4508993068
commit b4bb0f866e
3 changed files with 43 additions and 43 deletions

View File

@ -83,7 +83,7 @@ job "blocky" {
}
}
task "main" {
task "blocky" {
driver = "docker"
config {

View File

@ -47,7 +47,7 @@ job "redis" {
# }
}
task "main" {
task "redis" {
driver = "docker"
config {

View File

@ -90,7 +90,7 @@
"tableColumn": "",
"targets": [
{
"expr": "time() - min(node_boot_time_seconds{scrape_host=~\"$server\"})",
"expr": "time() - min(node_boot_time_seconds{consul_node=~\"$server\"})",
"hide": false,
"interval": "",
"intervalFactor": 2,
@ -181,7 +181,7 @@
"tableColumn": "",
"targets": [
{
"expr": "count(rate(container_last_seen{scrape_host=~\"$server\", name=~\".+\"}[$interval]))",
"expr": "count(rate(container_last_seen{consul_node=~\"$server\", name=~\".+\"}[$interval]))",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
@ -273,7 +273,7 @@
"tableColumn": "",
"targets": [
{
"expr": "max((node_filesystem_size_bytes{fstype=~\"xfs|ext4\",scrape_host=~\"$server\"} - node_filesystem_free_bytes{fstype=~\"xfs|ext4\",scrape_host=~\"$server\"} )/ node_filesystem_size_bytes{fstype=~\"xfs|ext4\",scrape_host=~\"$server\"})",
"expr": "max((node_filesystem_size_bytes{fstype=~\"xfs|ext4\",consul_node=~\"$server\"} - node_filesystem_free_bytes{fstype=~\"xfs|ext4\",consul_node=~\"$server\"} )/ node_filesystem_size_bytes{fstype=~\"xfs|ext4\",consul_node=~\"$server\"})",
"hide": false,
"interval": "",
"intervalFactor": 2,
@ -365,7 +365,7 @@
"tableColumn": "",
"targets": [
{
"expr": "max((node_memory_MemTotal_bytes{scrape_host=~\"$server\"} - node_memory_MemAvailable_bytes{scrape_host=~\"$server\"}) / node_memory_MemTotal_bytes{scrape_host=~\"$server\"}) * 100",
"expr": "max((node_memory_MemTotal_bytes{consul_node=~\"$server\"} - node_memory_MemAvailable_bytes{consul_node=~\"$server\"}) / node_memory_MemTotal_bytes{consul_node=~\"$server\"}) * 100",
"interval": "",
"intervalFactor": 2,
"legendFormat": "",
@ -456,7 +456,7 @@
"tableColumn": "",
"targets": [
{
"expr": "max(node_memory_SwapTotal_bytes{scrape_host=~\"$server\"} - node_memory_SwapFree_bytes{scrape_host=~\"$server\"})",
"expr": "max(node_memory_SwapTotal_bytes{consul_node=~\"$server\"} - node_memory_SwapFree_bytes{consul_node=~\"$server\"})",
"interval": "",
"intervalFactor": 2,
"legendFormat": "",
@ -547,7 +547,7 @@
"tableColumn": "",
"targets": [
{
"expr": "max(sum by(job, scrape_host)(node_load1{scrape_host=~\"$server\"}) / count by(job, scrape_host)(count by(job, scrape_host, cpu)(node_cpu_seconds_total{scrape_host=~\"$server\"})))",
"expr": "max(sum by(job, consul_node)(node_load1{consul_node=~\"$server\"}) / count by(job, consul_node)(count by(job, consul_node, cpu)(node_cpu_seconds_total{consul_node=~\"$server\"})))",
"interval": "",
"intervalFactor": 2,
"legendFormat": "",
@ -621,7 +621,7 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_network_receive_bytes_total{id=\"/\", scrape_host=~\"$server\"}[$interval])) by (id, scrape_host)",
"expr": "sum(rate(container_network_receive_bytes_total{id=\"/\", consul_node=~\"$server\"}[$interval])) by (id, consul_node)",
"interval": "",
"intervalFactor": 2,
"legendFormat": "RECEIVED",
@ -629,7 +629,7 @@
"step": 600
},
{
"expr": "- sum(rate(container_network_transmit_bytes_total{id=\"/\", scrape_host=~\"$server\"}[$interval])) by (id, scrape_host)",
"expr": "- sum(rate(container_network_transmit_bytes_total{id=\"/\", consul_node=~\"$server\"}[$interval])) by (id, consul_node)",
"hide": false,
"interval": "",
"intervalFactor": 2,
@ -733,11 +733,11 @@
"steppedLine": false,
"targets": [
{
"expr": "max by(scrape_host)(rate(process_cpu_seconds_total{job=\"node_exporter\", scrape_host=~\"$server\"}[$interval])) * 100",
"expr": "max by(consul_node)(rate(process_cpu_seconds_total{job=\"node_exporter\", consul_node=~\"$server\"}[$interval])) * 100",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{ scrape_host }}",
"legendFormat": "{{ consul_node }}",
"metric": "",
"refId": "C",
"step": 600
@ -871,11 +871,11 @@
"steppedLine": false,
"targets": [
{
"expr": "sum by(job, scrape_host)(node_load1{scrape_host=~\"$server\"}) / (count by(job, scrape_host)(count by(job, scrape_host, cpu)(node_cpu_seconds_total{scrape_host=~\"$server\"})))",
"expr": "sum by(job, consul_node)(node_load1{consul_node=~\"$server\"}) / (count by(job, consul_node)(count by(job, consul_node, cpu)(node_cpu_seconds_total{consul_node=~\"$server\"})))",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{ scrape_host }}",
"legendFormat": "{{ consul_node }}",
"refId": "A",
"step": 600
}
@ -1024,12 +1024,12 @@
"steppedLine": false,
"targets": [
{
"expr": "(sum by(scrape_host)(node_filesystem_size_bytes{fstype=~\"xfs|ext4\", scrape_host=~\"$server\", job=\"node_exporter\"}) - sum by(scrape_host)(node_filesystem_free_bytes{fstype=~\"xfs|ext4\", scrape_host=~\"$server\", job=\"node_exporter\"})) / sum by (scrape_host)(node_filesystem_size_bytes{fstype=~\"xfs|ext4\",scrape_host=~\"$server\", job=\"node_exporter\"})",
"expr": "(sum by(consul_node)(node_filesystem_size_bytes{fstype=~\"xfs|ext4\", consul_node=~\"$server\", job=\"node_exporter\"}) - sum by(consul_node)(node_filesystem_free_bytes{fstype=~\"xfs|ext4\", consul_node=~\"$server\", job=\"node_exporter\"})) / sum by (consul_node)(node_filesystem_size_bytes{fstype=~\"xfs|ext4\",consul_node=~\"$server\", job=\"node_exporter\"})",
"format": "time_series",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{ scrape_host }}",
"legendFormat": "{{ consul_node }}",
"refId": "A",
"step": 600
}
@ -1175,18 +1175,18 @@
"steppedLine": false,
"targets": [
{
"expr": "node_memory_MemAvailable_bytes{scrape_host=~\"$server\"} / node_memory_MemTotal_bytes{scrape_host=~\"$server\"}",
"expr": "node_memory_MemAvailable_bytes{consul_node=~\"$server\"} / node_memory_MemTotal_bytes{consul_node=~\"$server\"}",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{ scrape_host }} memory",
"legendFormat": "{{ consul_node }} memory",
"refId": "G",
"step": 600
},
{
"expr": "(node_memory_SwapTotal_bytes{scrape_host=~\"$server\"} - node_memory_SwapFree_bytes{scrape_host=~\"$server\"}) / node_memory_SwapTotal_bytes{scrape_host=~\"$server\"}",
"expr": "(node_memory_SwapTotal_bytes{consul_node=~\"$server\"} - node_memory_SwapFree_bytes{consul_node=~\"$server\"}) / node_memory_SwapTotal_bytes{consul_node=~\"$server\"}",
"interval": "",
"legendFormat": "{{ scrape_host }} swap",
"legendFormat": "{{ consul_node }} swap",
"refId": "A"
}
],
@ -1298,20 +1298,20 @@
"steppedLine": false,
"targets": [
{
"expr": "-sum(rate(node_disk_read_bytes_total{scrape_host=~\"$server\"}[$interval])) by (scrape_host, device)",
"expr": "-sum(rate(node_disk_read_bytes_total{consul_node=~\"$server\"}[$interval])) by (consul_node, device)",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "OUT on {{scrape_host}}:/{{device}}",
"legendFormat": "OUT on {{consul_node}}:/{{device}}",
"metric": "node_disk_read_bytes_total",
"refId": "A",
"step": 600
},
{
"expr": "sum(rate(node_disk_written_bytes_total{scrape_host=~\"$server\"}[$interval])) by (scrape_host, device)",
"expr": "sum(rate(node_disk_written_bytes_total{consul_node=~\"$server\"}[$interval])) by (consul_node, device)",
"interval": "",
"intervalFactor": 2,
"legendFormat": "IN on {{scrape_host}}:/{{device}}",
"legendFormat": "IN on {{consul_node}}:/{{device}}",
"metric": "",
"refId": "B",
"step": 600
@ -1412,15 +1412,15 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_network_receive_bytes_total{name=~\".+\", scrape_host=~\"$server\"}[$interval])) by (name, scrape_host)",
"expr": "sum(rate(container_network_receive_bytes_total{name=~\".+\", consul_node=~\"$server\"}[$interval])) by (name, consul_node)",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"refId": "A",
"step": 240
},
{
"expr": "- rate(container_network_transmit_bytes_total{name=~\".+\", scrape_host=~\"$server\"}[$interval])",
"expr": "- rate(container_network_transmit_bytes_total{name=~\".+\", consul_node=~\"$server\"}[$interval])",
"hide": true,
"interval": "",
"intervalFactor": 2,
@ -1528,15 +1528,15 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_network_transmit_bytes_total{name=~\".+\", scrape_host=~\"$server\"}[$interval])) by (name, scrape_host)",
"expr": "sum(rate(container_network_transmit_bytes_total{name=~\".+\", consul_node=~\"$server\"}[$interval])) by (name, consul_node)",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"refId": "A",
"step": 240
},
{
"expr": "rate(container_network_transmit_bytes_total{id=\"/\", scrape_host=~\"$server\"}[$interval])",
"expr": "rate(container_network_transmit_bytes_total{id=\"/\", consul_node=~\"$server\"}[$interval])",
"hide": true,
"interval": "",
"intervalFactor": 2,
@ -1642,11 +1642,11 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(container_cpu_usage_seconds_total{name=~\".+\", scrape_host=~\"$server\"}[$interval])) by (name, scrape_host) * 100",
"expr": "sum(rate(container_cpu_usage_seconds_total{name=~\".+\", consul_node=~\"$server\"}[$interval])) by (name, consul_node) * 100",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"metric": "",
"refId": "F",
"step": 240
@ -1748,11 +1748,11 @@
"steppedLine": false,
"targets": [
{
"expr": "sum(container_memory_rss{name=~\".+\", scrape_host=~\"$server\"}) by (scrape_host, name)",
"expr": "sum(container_memory_rss{name=~\".+\", consul_node=~\"$server\"}) by (consul_node, name)",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"refId": "A",
"step": 240
},
@ -1881,11 +1881,11 @@
"step": 240
},
{
"expr": "container_memory_usage_bytes{name=~\".+\", scrape_host=~\"$server\"}",
"expr": "container_memory_usage_bytes{name=~\".+\", consul_node=~\"$server\"}",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"refId": "C",
"step": 240
}
@ -1948,10 +1948,10 @@
],
"targets": [
{
"expr": "sum(100 - ((container_spec_memory_limit_bytes{name=~\".+\", scrape_host=~\"$server\"} - container_memory_usage_bytes{name=~\".+\", scrape_host=~\"$server\"}) * 100 / container_spec_memory_limit_bytes{name=~\".+\", scrape_host=~\"$server\"}) ) by (name, scrape_host) ",
"expr": "sum(100 - ((container_spec_memory_limit_bytes{name=~\".+\", consul_node=~\"$server\"} - container_memory_usage_bytes{name=~\".+\", consul_node=~\"$server\"}) * 100 / container_spec_memory_limit_bytes{name=~\".+\", consul_node=~\"$server\"}) ) by (name, consul_node) ",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"metric": "",
"refId": "A",
"step": 240
@ -2031,7 +2031,7 @@
],
"targets": [
{
"expr": "sum(container_spec_memory_limit_bytes{name=~\".+\", scrape_host=~\"$server\"} - container_memory_usage_bytes{name=~\".+\", scrape_host=~\"$server\"}) by (name) ",
"expr": "sum(container_spec_memory_limit_bytes{name=~\".+\", consul_node=~\"$server\"} - container_memory_usage_bytes{name=~\".+\", consul_node=~\"$server\"}) by (name) ",
"hide": true,
"interval": "",
"intervalFactor": 2,
@ -2041,11 +2041,11 @@
"step": 240
},
{
"expr": "sum(container_spec_memory_limit_bytes{name=~\".+\", scrape_host=~\"$server\"}) by (name, scrape_host) ",
"expr": "sum(container_spec_memory_limit_bytes{name=~\".+\", consul_node=~\"$server\"}) by (name, consul_node) ",
"hide": false,
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{name}}@{{scrape_host}}",
"legendFormat": "{{name}}@{{consul_node}}",
"refId": "B",
"step": 240
},
@ -2213,14 +2213,14 @@
]
},
"datasource": "Prometheus",
"definition": "label_values(node_boot_time_seconds, scrape_host)",
"definition": "label_values(node_boot_time_seconds, consul_node)",
"hide": 0,
"includeAll": false,
"label": "Node",
"multi": true,
"name": "server",
"options": [],
"query": "label_values(node_boot_time_seconds, scrape_host)",
"query": "label_values(node_boot_time_seconds, consul_node)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,