automatic configure prometheus
This commit is contained in:
parent
5fbe52eb11
commit
9f6d63cabe
2 changed files with 29 additions and 16 deletions
|
@ -1,9 +1,13 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
services.opentelemetry-collector.settings = {
|
services.opentelemetry-collector.settings = {
|
||||||
exporters.loki = {
|
exporters.loki = {
|
||||||
endpoint = "http://127.0.0.1:3100/loki/api/v1/push";
|
endpoint = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
|
||||||
default_labels_enabled = {
|
default_labels_enabled = {
|
||||||
exporter = true;
|
exporter = true;
|
||||||
job = true;
|
job = true;
|
||||||
|
@ -109,20 +113,16 @@
|
||||||
# user, group, dataDir, extraFlags, (configFile)
|
# user, group, dataDir, extraFlags, (configFile)
|
||||||
};
|
};
|
||||||
|
|
||||||
#services.nginx = {
|
services.grafana.provision.datasources.settings = {
|
||||||
# enable = true;
|
apiVersion = 1;
|
||||||
# virtualHosts.loki = {
|
datasources = [
|
||||||
# serverName = "loki.pepe.private";
|
{
|
||||||
# locations."/" = {
|
name = "Loki";
|
||||||
# proxyWebsockets = true;
|
type = "loki";
|
||||||
# proxyPass = "http://127.0.0.1:3100";
|
uid = "loki01";
|
||||||
# #extraConfig = ''
|
url = "http://localhost:${toString config.services.loki.configuration.server.http_listen_port}";
|
||||||
# # access_log off;
|
}
|
||||||
# # allow ${config.tinc.private.subnet};
|
];
|
||||||
# # deny all;
|
};
|
||||||
# #'';
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
#};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,17 @@
|
||||||
# keep data for 30 days
|
# keep data for 30 days
|
||||||
extraFlags = [ "--storage.tsdb.retention.time=90d" ];
|
extraFlags = [ "--storage.tsdb.retention.time=90d" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.grafana.provision.datasources.settings = {
|
||||||
|
apiVersion = 1;
|
||||||
|
datasources = [
|
||||||
|
{
|
||||||
|
name = "Prometheus";
|
||||||
|
type = "prometheus";
|
||||||
|
uid = "prometheus01";
|
||||||
|
url = "http://localhost:${toString config.services.prometheus.port}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue