add domain and hostname labels
This commit is contained in:
parent
516dfc7e44
commit
a784c08761
8 changed files with 433 additions and 117 deletions
|
|
@ -525,6 +525,10 @@ in
|
|||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:9959"];
|
||||
labels = {
|
||||
"hostname" = config.networking.hostName;
|
||||
"domain" = cfg.domain;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ let
|
|||
contracts = pkgs.callPackage ../contracts {};
|
||||
|
||||
fqdn = "${cfg.subdomain}.${cfg.domain}";
|
||||
|
||||
commonLabels = {
|
||||
hostname = config.networking.hostName;
|
||||
domain = cfg.domain;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.shb.monitoring = {
|
||||
|
|
@ -406,6 +411,8 @@ in
|
|||
path = "/var/log/journal";
|
||||
# matches = "_TRANSPORT=kernel";
|
||||
labels = {
|
||||
domain = cfg.domain;
|
||||
hostname = config.networking.hostName;
|
||||
job = "systemd-journal";
|
||||
};
|
||||
};
|
||||
|
|
@ -443,6 +450,7 @@ in
|
|||
job_name = "node";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
}
|
||||
{
|
||||
|
|
@ -452,24 +460,28 @@ in
|
|||
honor_labels = true;
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:19999" ];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "smartctl";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
}
|
||||
{
|
||||
job_name = "prometheus_internal";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.port}"];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
}
|
||||
] ++ (lib.lists.optional config.services.nginx.enable {
|
||||
job_name = "nginx";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
# }) ++ (lib.optional (builtins.length (lib.attrNames config.services.redis.servers) > 0) {
|
||||
# job_name = "redis";
|
||||
|
|
@ -489,6 +501,7 @@ in
|
|||
job_name = "dnsmasq";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.dnsmasq.port}"];
|
||||
labels = commonLabels;
|
||||
}];
|
||||
});
|
||||
services.prometheus.exporters.nginx = lib.mkIf config.services.nginx.enable {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
"graphTooltip": 0,
|
||||
"id": 8,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -39,6 +38,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -182,6 +182,7 @@
|
|||
"axisPlacement": "auto",
|
||||
"axisSoftMin": 0.5,
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -254,7 +255,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -325,6 +326,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -398,7 +400,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -457,6 +459,10 @@
|
|||
"type": "loki",
|
||||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 24,
|
||||
|
|
@ -474,6 +480,7 @@
|
|||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": false
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -512,8 +519,7 @@
|
|||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
"color": "green"
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
|
|
@ -743,28 +749,23 @@
|
|||
"type": "table"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
"refresh": "",
|
||||
"schemaVersion": 38,
|
||||
"schemaVersion": 40,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"allValue": ".+",
|
||||
"current": {
|
||||
"selected": true,
|
||||
"text": [
|
||||
"All"
|
||||
],
|
||||
"value": [
|
||||
"$__all"
|
||||
]
|
||||
"text": "All",
|
||||
"value": "$__all"
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"definition": "query_result(max by (name) (node_systemd_unit_state))",
|
||||
"hide": 0,
|
||||
"includeAll": true,
|
||||
"multi": true,
|
||||
"name": "service",
|
||||
|
|
@ -776,27 +777,23 @@
|
|||
},
|
||||
"refresh": 1,
|
||||
"regex": "/name=\"(?<value>.*)\\.service\"/",
|
||||
"skipUrlSync": false,
|
||||
"sort": 1,
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
"current": {
|
||||
"selected": false,
|
||||
"text": "",
|
||||
"value": ""
|
||||
"text": ".+",
|
||||
"value": ".+"
|
||||
},
|
||||
"hide": 0,
|
||||
"name": "server_name",
|
||||
"options": [
|
||||
{
|
||||
"selected": true,
|
||||
"text": "",
|
||||
"value": ""
|
||||
"text": ".+",
|
||||
"value": ".+"
|
||||
}
|
||||
],
|
||||
"query": ".+",
|
||||
"skipUrlSync": false,
|
||||
"type": "textbox"
|
||||
}
|
||||
]
|
||||
|
|
@ -809,6 +806,6 @@
|
|||
"timezone": "",
|
||||
"title": "Errors",
|
||||
"uid": "d66242cf-71e8-417c-8ef7-51b0741545df",
|
||||
"version": 29,
|
||||
"version": 32,
|
||||
"weekStart": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
"graphTooltip": 0,
|
||||
"id": 6,
|
||||
"links": [],
|
||||
"liveNow": false,
|
||||
"panels": [
|
||||
{
|
||||
"collapsed": false,
|
||||
"gridPos": {
|
||||
"h": 1,
|
||||
"w": 24,
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
"y": 0
|
||||
},
|
||||
"id": 12,
|
||||
"panels": [],
|
||||
"title": "Node",
|
||||
"type": "row"
|
||||
},
|
||||
|
|
@ -51,6 +52,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -204,6 +206,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -211,7 +214,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "netdata_system_memory_full_pressure_stall_time_ms_average{instance=~\"$instance\"} * -1",
|
||||
"expr": "netdata_system_memory_full_pressure_stall_time_ms_average{hostname=~\"$hostname\"} * -1",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "full stall time",
|
||||
|
|
@ -269,6 +272,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -422,6 +426,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -429,7 +434,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "netdata_system_memory_full_pressure_stall_time_ms_average{instance=~\"$instance\"} * -1",
|
||||
"expr": "netdata_system_memory_full_pressure_stall_time_ms_average{hostname=~\"$hostname\"} * -1",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "full stall time",
|
||||
|
|
@ -456,7 +461,7 @@
|
|||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "sum by(dimension, service_name) (netdata_systemd_service_memory_usage_MiB_average{instance=~\"$instance\", service_name=~\"$service\", dimension=\"swap\"})",
|
||||
"expr": "sum by(dimension, service_name) (netdata_systemd_service_memory_usage_MiB_average{hostname=~\"$hostname\", service_name=~\"$service\", dimension=\"swap\"})",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
|
|
@ -487,6 +492,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -597,6 +603,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -604,7 +611,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "netdata_system_cpu_some_pressure_stall_time_ms_average{instance=~\"$instance\"} * -1",
|
||||
"expr": "netdata_system_cpu_some_pressure_stall_time_ms_average{hostname=~\"$hostname\"} * -1",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "some stall time",
|
||||
|
|
@ -618,7 +625,7 @@
|
|||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"expr": "sum by(dimension, service_name) (netdata_systemd_service_cpu_utilization_percentage_average{instance=~\"$instance\", service_name=~\"$service\"})",
|
||||
"expr": "sum by(dimension, service_name) (netdata_systemd_service_cpu_utilization_percentage_average{hostname=~\"$hostname\", service_name=~\"$service\"})",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
|
|
@ -649,6 +656,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -814,6 +822,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -821,7 +830,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "netdata_system_io_full_pressure_stall_time_ms_average{instance=~\"$instance\"} * -1",
|
||||
"expr": "netdata_system_io_full_pressure_stall_time_ms_average{hostname=~\"$hostname\"} * -1",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "full stall time",
|
||||
|
|
@ -878,6 +887,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -943,6 +953,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -950,7 +961,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "netdata_disk_io_KiB_persec_average{instance=~\"$instance\", chart=~\"disk.sd.+\"}",
|
||||
"expr": "netdata_disk_io_KiB_persec_average{hostname=~\"$hostname\", chart=~\"disk.sd.+\"}",
|
||||
"instant": false,
|
||||
"legendFormat": "{{device}} / {{dimension}}",
|
||||
"range": true,
|
||||
|
|
@ -1031,7 +1042,8 @@
|
|||
"layout": "auto"
|
||||
},
|
||||
"tooltip": {
|
||||
"show": true,
|
||||
"mode": "single",
|
||||
"showColorScale": false,
|
||||
"yHistogram": false
|
||||
},
|
||||
"yAxis": {
|
||||
|
|
@ -1041,7 +1053,7 @@
|
|||
"unit": "s"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1049,7 +1061,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 100",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 100",
|
||||
"legendFormat": "{{server_name}}",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
|
|
@ -1145,6 +1157,7 @@
|
|||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "points",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
|
|
@ -1175,7 +1188,8 @@
|
|||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
|
|
@ -1210,7 +1224,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1218,7 +1232,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 100",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 100",
|
||||
"legendFormat": "",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
|
|
@ -1317,7 +1331,8 @@
|
|||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
|
|
@ -1354,7 +1369,7 @@
|
|||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1362,7 +1377,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 1",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"nginx.service\"} | pattern \"<_> <_> <line>\" | line_format \"{{.line}}\" | json | __error__ != \"JSONParserErr\" | request_time > 1",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
|
|
@ -1411,7 +1426,8 @@
|
|||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green"
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
|
|
@ -1472,7 +1488,7 @@
|
|||
},
|
||||
"showHeader": true
|
||||
},
|
||||
"pluginVersion": "10.2.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1480,7 +1496,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"postgresql.service\"} | regexp \".*duration: (?P<duration_ms>[0-9.]+) ms (?P<statement>.*)\" | duration_ms > 500 | __error__ != \"LabelFilterErr\"",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"postgresql.service\"} | regexp \".*duration: (?P<duration_ms>[0-9.]+) ms (?P<statement>.*)\" | duration_ms > 500 | __error__ != \"LabelFilterErr\"",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
|
|
@ -1513,56 +1529,55 @@
|
|||
"type": "table"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
"refresh": "1m",
|
||||
"schemaVersion": 38,
|
||||
"schemaVersion": 40,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"allValue": ".*",
|
||||
"current": {
|
||||
"selected": true,
|
||||
"text": [
|
||||
"127.0.0.1:19999"
|
||||
"baryum"
|
||||
],
|
||||
"value": [
|
||||
"127.0.0.1:19999"
|
||||
"baryum"
|
||||
]
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"definition": "label_values(netdata_systemd_service_unit_state_state_average,instance)",
|
||||
"hide": 0,
|
||||
"definition": "label_values(netdata_systemd_service_unit_state_state_average,hostname)",
|
||||
"includeAll": false,
|
||||
"multi": true,
|
||||
"name": "instance",
|
||||
"name": "hostname",
|
||||
"options": [],
|
||||
"query": {
|
||||
"qryType": 1,
|
||||
"query": "label_values(netdata_systemd_service_unit_state_state_average,instance)",
|
||||
"query": "label_values(netdata_systemd_service_unit_state_state_average,hostname)",
|
||||
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 0,
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
"allValue": ".*",
|
||||
"current": {
|
||||
"selected": false,
|
||||
"text": "All",
|
||||
"value": "$__all"
|
||||
"text": [
|
||||
"All"
|
||||
],
|
||||
"value": [
|
||||
"$__all"
|
||||
]
|
||||
},
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"definition": "label_values(netdata_systemd_service_unit_state_state_average,unit_name)",
|
||||
"hide": 0,
|
||||
"includeAll": true,
|
||||
"multi": true,
|
||||
"name": "service",
|
||||
|
|
@ -1574,8 +1589,6 @@
|
|||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"skipUrlSync": false,
|
||||
"sort": 0,
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
|
|
@ -1588,6 +1601,6 @@
|
|||
"timezone": "",
|
||||
"title": "Performance",
|
||||
"uid": "e01156bf-cdba-42eb-9845-a401dd634d41",
|
||||
"version": 54,
|
||||
"version": 82,
|
||||
"weekStart": ""
|
||||
}
|
||||
|
|
|
|||
286
modules/blocks/monitoring/dashboards/Scraping Jobs.json
Normal file
286
modules/blocks/monitoring/dashboards/Scraping Jobs.json
Normal file
|
|
@ -0,0 +1,286 @@
|
|||
{
|
||||
"annotations": {
|
||||
"list": [
|
||||
{
|
||||
"builtIn": 1,
|
||||
"datasource": {
|
||||
"type": "grafana",
|
||||
"uid": "-- Grafana --"
|
||||
},
|
||||
"enable": true,
|
||||
"hide": true,
|
||||
"iconColor": "rgba(0, 211, 255, 1)",
|
||||
"name": "Annotations & Alerts",
|
||||
"type": "dashboard"
|
||||
}
|
||||
]
|
||||
},
|
||||
"editable": true,
|
||||
"fiscalYearStartMonth": 0,
|
||||
"graphTooltip": 0,
|
||||
"id": 5,
|
||||
"links": [],
|
||||
"panels": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"mode": "palette-classic"
|
||||
},
|
||||
"custom": {
|
||||
"axisBorderShow": false,
|
||||
"axisCenteredZero": false,
|
||||
"axisColorMode": "text",
|
||||
"axisLabel": "",
|
||||
"axisPlacement": "auto",
|
||||
"barAlignment": 0,
|
||||
"barWidthFactor": 0.6,
|
||||
"drawStyle": "line",
|
||||
"fillOpacity": 0,
|
||||
"gradientMode": "none",
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineInterpolation": "linear",
|
||||
"lineWidth": 1,
|
||||
"pointSize": 5,
|
||||
"scaleDistribution": {
|
||||
"type": "linear"
|
||||
},
|
||||
"showPoints": "auto",
|
||||
"spanNulls": false,
|
||||
"stacking": {
|
||||
"group": "A",
|
||||
"mode": "none"
|
||||
},
|
||||
"thresholdsStyle": {
|
||||
"mode": "off"
|
||||
}
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 4,
|
||||
"options": {
|
||||
"legend": {
|
||||
"calcs": [],
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": true
|
||||
},
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "rate(net_conntrack_dialer_conn_failed_total{hostname=~\"$hostname\"}[2m]) > 0",
|
||||
"instant": false,
|
||||
"legendFormat": "{{dialer_name}} - {{reason}}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"title": "Errors",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": {
|
||||
"fixedColor": "red",
|
||||
"mode": "fixed"
|
||||
},
|
||||
"custom": {
|
||||
"fillOpacity": 70,
|
||||
"hideFrom": {
|
||||
"legend": false,
|
||||
"tooltip": false,
|
||||
"viz": false
|
||||
},
|
||||
"insertNulls": false,
|
||||
"lineWidth": 0,
|
||||
"spanNulls": false
|
||||
},
|
||||
"mappings": [],
|
||||
"thresholds": {
|
||||
"mode": "absolute",
|
||||
"steps": [
|
||||
{
|
||||
"color": "green",
|
||||
"value": null
|
||||
},
|
||||
{
|
||||
"color": "red",
|
||||
"value": 80
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"overrides": []
|
||||
},
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 8
|
||||
},
|
||||
"id": 3,
|
||||
"options": {
|
||||
"alignValue": "center",
|
||||
"legend": {
|
||||
"displayMode": "list",
|
||||
"placement": "bottom",
|
||||
"showLegend": false
|
||||
},
|
||||
"mergeValues": true,
|
||||
"rowHeight": 0.9,
|
||||
"showValue": "never",
|
||||
"tooltip": {
|
||||
"mode": "single",
|
||||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "prometheus_sd_discovered_targets{hostname=~\"$hostname\"}",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "{{config}}",
|
||||
"range": true,
|
||||
"refId": "All"
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "label_replace(increase((sum by(dialer_name) (net_conntrack_dialer_conn_failed_total{hostname=~\"$hostname\"}))[15m:1m]), \"config\", \"$1\", \"dialer_name\", \"(.*)\") > 10",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "{{dialer_name}}",
|
||||
"range": true,
|
||||
"refId": "Failed"
|
||||
}
|
||||
],
|
||||
"title": "Scraping jobs",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "labelsToFields",
|
||||
"options": {
|
||||
"keepLabels": [
|
||||
"config"
|
||||
],
|
||||
"mode": "columns"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "merge",
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": "organize",
|
||||
"options": {
|
||||
"excludeByName": {
|
||||
"prometheus_sd_discovered_targets": true
|
||||
},
|
||||
"indexByName": {},
|
||||
"renameByName": {
|
||||
"prometheus_sd_discovered_targets": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "partitionByValues",
|
||||
"options": {
|
||||
"fields": [
|
||||
"config"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "state-timeline"
|
||||
}
|
||||
],
|
||||
"preload": false,
|
||||
"refresh": "",
|
||||
"schemaVersion": 40,
|
||||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"current": {
|
||||
"text": "baryum",
|
||||
"value": "baryum"
|
||||
},
|
||||
"definition": "label_values(up,hostname)",
|
||||
"includeAll": false,
|
||||
"name": "hostname",
|
||||
"options": [],
|
||||
"query": {
|
||||
"qryType": 1,
|
||||
"query": "label_values(up,hostname)",
|
||||
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"type": "query"
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"from": "now-6h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {},
|
||||
"timezone": "",
|
||||
"title": "Scraping Jobs",
|
||||
"uid": "debb763d-77aa-47bd-9290-2e02583c8ed2",
|
||||
"version": 15,
|
||||
"weekStart": ""
|
||||
}
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
"sizing": "auto",
|
||||
"text": {}
|
||||
},
|
||||
"pluginVersion": "11.0.0",
|
||||
"pluginVersion": "11.4.0",
|
||||
"repeat": "mountpoint",
|
||||
"repeatDirection": "v",
|
||||
"targets": [
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "node_filesystem_size_bytes{mountpoint=\"$mountpoint\"} - node_filesystem_free_bytes{mountpoint=\"$mountpoint\"}",
|
||||
"expr": "node_filesystem_size_bytes{hostname=~\"$hostname\",mountpoint=\"$mountpoint\"} - node_filesystem_free_bytes{hostname=~\"$hostname\",mountpoint=\"$mountpoint\"}",
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
"range": true,
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "node_filesystem_size_bytes{mountpoint=\"$mountpoint\"}",
|
||||
"expr": "node_filesystem_size_bytes{hostname=~\"$hostname\",mountpoint=\"$mountpoint\"}",
|
||||
"hide": false,
|
||||
"instant": false,
|
||||
"legendFormat": "__auto",
|
||||
|
|
@ -277,15 +277,16 @@
|
|||
"textMode": "auto",
|
||||
"wideLayout": true
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"exemplar": true,
|
||||
"expr": "deluge_torrents",
|
||||
"expr": "deluge_torrents{hostname=~\"$hostname\"}",
|
||||
"instant": false,
|
||||
"interval": "",
|
||||
"legendFormat": "{{state}}",
|
||||
|
|
@ -381,7 +382,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -389,7 +390,7 @@
|
|||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "deluge_torrent_done_total{state=\"downloading\"} / deluge_torrent_size_total{state=\"downloading\"}",
|
||||
"expr": "deluge_torrent_done_total{hostname=~\"$hostname\",state=\"downloading\",name=~\"$torrent\"} / deluge_torrent_size_total{hostname=~\"$hostname\",state=\"downloading\",name=~\"$torrent\"}",
|
||||
"legendFormat": "{{name}}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
|
|
@ -472,7 +473,7 @@
|
|||
"sizing": "auto",
|
||||
"valueMode": "color"
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -481,7 +482,7 @@
|
|||
},
|
||||
"editorMode": "code",
|
||||
"exemplar": false,
|
||||
"expr": "deluge_torrent_time_since_download{state=\"downloading\",name=~\"$torrent\"}",
|
||||
"expr": "deluge_torrent_time_since_download{hostname=~\"$hostname\",state=\"downloading\",name=~\"$torrent\"}",
|
||||
"instant": true,
|
||||
"interval": "",
|
||||
"legendFormat": "{{name}}",
|
||||
|
|
@ -603,7 +604,7 @@
|
|||
"sizing": "auto",
|
||||
"valueMode": "color"
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -612,7 +613,7 @@
|
|||
},
|
||||
"editorMode": "code",
|
||||
"exemplar": false,
|
||||
"expr": "time()-deluge_torrent_last_seen_complete{state=\"downloading\",name=~\"$torrent\"}",
|
||||
"expr": "time()-deluge_torrent_last_seen_complete{hostname=~\"$hostname\",state=\"downloading\",name=~\"$torrent\"}",
|
||||
"instant": true,
|
||||
"interval": "",
|
||||
"legendFormat": "{{name}}",
|
||||
|
|
@ -740,20 +741,25 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "df80f9f5-97d7-4112-91d8-72f523a02b09"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "code",
|
||||
"exemplar": true,
|
||||
"expr": "rate(node_network_receive_bytes_total{device=\"tun1\"}[1m])",
|
||||
"expr": "avg by(device) (rate(node_network_receive_bytes_total{hostname=~\"$hostname\",device=~\"tun.*\"}[5m]))",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
"interval": "",
|
||||
"legendFormat": "in",
|
||||
"legendFormat": "in: {{ device }}",
|
||||
"range": true,
|
||||
"refId": "A"
|
||||
"refId": "A",
|
||||
"useBackend": false
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -762,10 +768,10 @@
|
|||
},
|
||||
"editorMode": "code",
|
||||
"exemplar": true,
|
||||
"expr": "rate(node_network_transmit_bytes_total{device=\"tun1\"}[1m])",
|
||||
"expr": "-avg by(device) (rate(node_network_transmit_bytes_total{device=~\"tun.*\"}[5m]))",
|
||||
"hide": false,
|
||||
"interval": "",
|
||||
"legendFormat": "out",
|
||||
"legendFormat": "out: {{ device }}",
|
||||
"range": true,
|
||||
"refId": "B"
|
||||
}
|
||||
|
|
@ -866,7 +872,7 @@
|
|||
"sort": "none"
|
||||
}
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -875,7 +881,7 @@
|
|||
},
|
||||
"editorMode": "code",
|
||||
"exemplar": true,
|
||||
"expr": "netdata_systemd_service_unit_state_state_average{unit_name=~\"deluged|delugeweb|openvpn.+\",dimension=\"active\"}",
|
||||
"expr": "netdata_systemd_service_unit_state_state_average{hostname=~\"$hostname\",unit_name=~\"deluged|delugeweb|openvpn.+\",dimension=\"active\"}",
|
||||
"interval": "",
|
||||
"legendFormat": "{{unit_name}}",
|
||||
"range": true,
|
||||
|
|
@ -911,7 +917,7 @@
|
|||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": false
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -919,7 +925,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"deluged.service\",level=~\"$level\"}",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"deluged.service\",level=~\"$level\"}",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
|
|
@ -953,7 +959,7 @@
|
|||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": false
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -961,7 +967,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=\"deluged.service\"} |= \"on_alert_external_ip\" | regexp \".+on_alert_external_ip: (?P<ip>.+)\" | line_format \"{{.ip}}\"",
|
||||
"expr": "{hostname=~\"$hostname\",unit=\"deluged.service\"} |= \"on_alert_external_ip\" | regexp \".+on_alert_external_ip: (?P<ip>.+)\" | line_format \"{{.ip}}\"",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
|
|
@ -995,7 +1001,7 @@
|
|||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": false
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1003,7 +1009,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=~\"openvpn.+.service\"} |= \"config -s listen_interface\" | pattern \"<_> listen_interface <ip>'\" | line_format \"{{.ip}}\"",
|
||||
"expr": "{hostname=~\"$hostname\",unit=~\"openvpn.+.service\"} |= \"config -s listen_interface\" | pattern \"<_> listen_interface <ip>'\" | line_format \"{{.ip}}\"",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
}
|
||||
|
|
@ -1037,7 +1043,7 @@
|
|||
"sortOrder": "Descending",
|
||||
"wrapLogMessage": false
|
||||
},
|
||||
"pluginVersion": "11.3.0+security-01",
|
||||
"pluginVersion": "11.4.0",
|
||||
"targets": [
|
||||
{
|
||||
"datasource": {
|
||||
|
|
@ -1045,7 +1051,7 @@
|
|||
"uid": "cd6cc53e-840c-484d-85f7-96fede324006"
|
||||
},
|
||||
"editorMode": "code",
|
||||
"expr": "{unit=~\"openvpn.+.service\",level=~\"$level\"}",
|
||||
"expr": "{hostname=~\"$hostname\",unit=~\"openvpn.+.service\",level=~\"$level\"}",
|
||||
"legendFormat": "",
|
||||
"queryType": "range",
|
||||
"refId": "A"
|
||||
|
|
@ -1061,34 +1067,6 @@
|
|||
"tags": [],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"allValue": ".*",
|
||||
"current": {
|
||||
"text": [
|
||||
"$__all"
|
||||
],
|
||||
"value": [
|
||||
"$__all"
|
||||
]
|
||||
},
|
||||
"includeAll": true,
|
||||
"multi": true,
|
||||
"name": "level",
|
||||
"options": [
|
||||
{
|
||||
"selected": false,
|
||||
"text": "warning",
|
||||
"value": "warning"
|
||||
},
|
||||
{
|
||||
"selected": false,
|
||||
"text": "error",
|
||||
"value": "error"
|
||||
}
|
||||
],
|
||||
"query": "warning,error",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"current": {
|
||||
"text": [
|
||||
|
|
@ -1122,6 +1100,23 @@
|
|||
"query": "/srv/movies,/srv/music,/srv/series",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"current": {
|
||||
"text": "baryum",
|
||||
"value": "baryum"
|
||||
},
|
||||
"definition": "label_values(up,hostname)",
|
||||
"name": "hostname",
|
||||
"options": [],
|
||||
"query": {
|
||||
"qryType": 1,
|
||||
"query": "label_values(up,hostname)",
|
||||
"refId": "PrometheusVariableQueryEditor-VariableQuery"
|
||||
},
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"type": "query"
|
||||
},
|
||||
{
|
||||
"current": {
|
||||
"text": "All",
|
||||
|
|
@ -1155,6 +1150,6 @@
|
|||
"timezone": "",
|
||||
"title": "Torrents",
|
||||
"uid": "Bg5L6T17k",
|
||||
"version": 16,
|
||||
"version": 22,
|
||||
"weekStart": ""
|
||||
}
|
||||
|
|
@ -392,6 +392,10 @@ in
|
|||
job_name = "deluge";
|
||||
static_configs = [{
|
||||
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.deluge.port}"];
|
||||
labels = {
|
||||
"hostname" = config.networking.hostName;
|
||||
"domain" = cfg.domain;
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
|
|
|||
|
|
@ -290,6 +290,10 @@ in
|
|||
static_configs = [
|
||||
{
|
||||
targets = ["127.0.0.1:8096"];
|
||||
labels = {
|
||||
"hostname" = config.networking.hostName;
|
||||
"domain" = cfg.domain;
|
||||
};
|
||||
}
|
||||
];
|
||||
}];
|
||||
|
|
|
|||
Loading…
Reference in a new issue