1
0
Fork 0

switch to netdata to pull most of the metrics

This commit is contained in:
ibizaman 2023-12-17 23:09:48 -08:00 committed by Pierre Penninckx
parent 036d2b92a5
commit 6f71d64257
3 changed files with 1113 additions and 149 deletions

View file

@ -378,35 +378,36 @@ in
services.prometheus.scrapeConfigs = [ services.prometheus.scrapeConfigs = [
{ {
job_name = "node"; job_name = "node";
static_configs = [ static_configs = [{
{ targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"]; }];
} }
]; {
job_name = "netdata";
metrics_path = "/api/v1/allmetrics";
params.format = [ "prometheus" ];
honor_labels = true;
static_configs = [{
targets = [ "127.0.0.1:19999" ];
}];
} }
{ {
job_name = "smartctl"; job_name = "smartctl";
static_configs = [ static_configs = [{
{ targets = ["127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"];
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"]; }];
}
];
} }
{ {
job_name = "prometheus_internal"; job_name = "prometheus_internal";
static_configs = [ static_configs = [{
{ targets = ["127.0.0.1:${toString config.services.prometheus.port}"];
targets = ["127.0.0.1:${toString config.services.prometheus.port}"]; }];
}
];
} }
] ++ (lib.lists.optional config.services.nginx.enable { ] ++ (lib.lists.optional config.services.nginx.enable {
job_name = "nginx"; job_name = "nginx";
static_configs = [ static_configs = [{
{ targets = ["127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"];
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"]; }];
}
];
# }) ++ (lib.optional (builtins.length (lib.attrNames config.services.redis.servers) > 0) { # }) ++ (lib.optional (builtins.length (lib.attrNames config.services.redis.servers) > 0) {
# job_name = "redis"; # job_name = "redis";
# static_configs = [ # static_configs = [
@ -423,28 +424,26 @@ in
# ]; # ];
}) ++ (lib.optional config.services.dnsmasq.enable { }) ++ (lib.optional config.services.dnsmasq.enable {
job_name = "dnsmasq"; job_name = "dnsmasq";
static_configs = [ static_configs = [{
{ targets = ["127.0.0.1:${toString config.services.prometheus.exporters.dnsmasq.port}"];
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.dnsmasq.port}"]; }];
}
];
}); });
services.prometheus.exporters.nginx = lib.mkIf config.services.nginx.enable { services.prometheus.exporters.nginx = lib.mkIf config.services.nginx.enable {
enable = true; enable = true;
port = 9113; port = 9111;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
scrapeUri = "http://localhost:80/nginx_status"; scrapeUri = "http://localhost:80/nginx_status";
}; };
services.prometheus.exporters.node = { services.prometheus.exporters.node = {
enable = true; enable = true;
# https://github.com/prometheus/node_exporter#collectors # https://github.com/prometheus/node_exporter#collectors
enabledCollectors = ["systemd" "processes" "ethtool"]; enabledCollectors = ["ethtool"];
port = 9115; port = 9112;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
}; };
services.prometheus.exporters.smartctl = { services.prometheus.exporters.smartctl = {
enable = true; enable = true;
port = 9117; port = 9115;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
}; };
# services.prometheus.exporters.redis = lib.mkIf (builtins.length (lib.attrNames config.services.redis.servers) > 0) { # services.prometheus.exporters.redis = lib.mkIf (builtins.length (lib.attrNames config.services.redis.servers) > 0) {
@ -460,9 +459,21 @@ in
# }; # };
services.prometheus.exporters.dnsmasq = lib.mkIf config.services.dnsmasq.enable { services.prometheus.exporters.dnsmasq = lib.mkIf config.services.dnsmasq.enable {
enable = true; enable = true;
port = 9123; port = 9211;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
}; };
services.nginx.statusPage = lib.mkDefault config.services.nginx.enable; services.nginx.statusPage = lib.mkDefault config.services.nginx.enable;
services.netdata = {
enable = true;
config = {
# web.mode = "none";
# web."bind to" = "127.0.0.1:19999";
global = {
"debug log" = "syslog";
"access log" = "syslog";
"error log" = "syslog";
};
};
};
}; };
} }

View file

@ -180,6 +180,7 @@
"axisColorMode": "text", "axisColorMode": "text",
"axisLabel": "", "axisLabel": "",
"axisPlacement": "auto", "axisPlacement": "auto",
"axisSoftMin": 0.5,
"barAlignment": 0, "barAlignment": 0,
"drawStyle": "line", "drawStyle": "line",
"fillOpacity": 0, "fillOpacity": 0,
@ -207,6 +208,7 @@
} }
}, },
"mappings": [], "mappings": [],
"max": 1.01,
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -349,6 +351,8 @@
} }
}, },
"mappings": [], "mappings": [],
"max": 1.01,
"min": 0,
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
@ -465,8 +469,8 @@
"enableLogDetails": true, "enableLogDetails": true,
"prettifyLogMessage": false, "prettifyLogMessage": false,
"showCommonLabels": false, "showCommonLabels": false,
"showLabels": false, "showLabels": true,
"showTime": false, "showTime": true,
"sortOrder": "Descending", "sortOrder": "Descending",
"wrapLogMessage": false "wrapLogMessage": false
}, },
@ -508,7 +512,8 @@
"mode": "absolute", "mode": "absolute",
"steps": [ "steps": [
{ {
"color": "green" "color": "green",
"value": null
}, },
{ {
"color": "red", "color": "red",
@ -517,7 +522,20 @@
] ]
} }
}, },
"overrides": [] "overrides": [
{
"matcher": {
"id": "byName",
"options": "Time"
},
"properties": [
{
"id": "custom.width",
"value": 167
}
]
}
]
}, },
"gridPos": { "gridPos": {
"h": 14, "h": 14,
@ -543,7 +561,8 @@
], ],
"show": false "show": false
}, },
"showHeader": true "showHeader": true,
"sortBy": []
}, },
"pluginVersion": "10.2.0", "pluginVersion": "10.2.0",
"targets": [ "targets": [
@ -563,34 +582,46 @@
{ {
"id": "extractFields", "id": "extractFields",
"options": { "options": {
"replace": true, "keepTime": false,
"replace": false,
"source": "Line" "source": "Line"
} }
}, },
{ {
"id": "organize", "id": "organize",
"options": { "options": {
"excludeByName": {}, "excludeByName": {
"Line": true,
"id": true,
"labels": true,
"time_local": true,
"tsNs": true
},
"indexByName": { "indexByName": {
"body_bytes_sent": 9, "Line": 21,
"bytes_sent": 8, "Time": 0,
"gzip_ration": 11, "body_bytes_sent": 10,
"post": 12, "bytes_sent": 9,
"referrer": 10, "gzip_ration": 12,
"remote_addr": 3, "id": 23,
"remote_user": 6, "labels": 20,
"request": 4, "post": 13,
"request_length": 7, "referrer": 11,
"request_time": 15, "remote_addr": 4,
"server_name": 2, "remote_user": 7,
"status": 1, "request": 5,
"time_local": 0, "request_length": 8,
"upstream_addr": 13, "request_time": 16,
"upstream_connect_time": 17, "server_name": 3,
"upstream_header_time": 18, "status": 2,
"upstream_response_time": 16, "time_local": 1,
"upstream_status": 14, "tsNs": 22,
"user_agent": 5 "upstream_addr": 14,
"upstream_connect_time": 18,
"upstream_header_time": 19,
"upstream_response_time": 17,
"upstream_status": 15,
"user_agent": 6
}, },
"renameByName": {} "renameByName": {}
} }
@ -718,13 +749,14 @@
"templating": { "templating": {
"list": [ "list": [
{ {
"allValue": ".+",
"current": { "current": {
"selected": true, "selected": true,
"text": [ "text": [
"jellyfin" "All"
], ],
"value": [ "value": [
"jellyfin" "$__all"
] ]
}, },
"datasource": { "datasource": {
@ -777,6 +809,6 @@
"timezone": "", "timezone": "",
"title": "Errors", "title": "Errors",
"uid": "d66242cf-71e8-417c-8ef7-51b0741545df", "uid": "d66242cf-71e8-417c-8ef7-51b0741545df",
"version": 16, "version": 29,
"weekStart": "" "weekStart": ""
} }

File diff suppressed because it is too large Load diff