configure opentelemetry on orbi

This commit is contained in:
Ingolf Wagner 2024-05-14 17:06:38 +02:00
parent 4857e6a766
commit 9f3e7b698a
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 62 additions and 5 deletions

View file

@ -40,9 +40,10 @@
# --------- # ---------
#./loki.nix #./loki.nix
#./loki-promtail.nix #./loki-promtail.nix
##./prometheus.nix
#./grafana.nix #./grafana.nix
./telegraf.nix ./system-telegraf.nix
./system-opentelemetry.nix
#./system-prometheus.nix
#./cache.nix #./cache.nix
]; ];

View file

@ -0,0 +1,51 @@
{ pkgs, ... }:
{
services.opentelemetry-collector = {
enable = true;
package = pkgs.unstable.opentelemetry-collector-contrib;
settings = {
receivers = {
# provide a influxdb sink
influxdb = {
endpoint = "127.0.0.1:8088";
};
# scrape opentelemetry-colectors metrics
prometheus.config.scrape_configs = [
{
job_name = "netdata";
scrape_interval = "10s";
metrics_path = "/api/v1/allmetrics";
params.format = [ "prometheus" ];
static_configs = [{ targets = [ "127.0.0.1:19999" ]; }];
}
{
job_name = "otelcol";
scrape_interval = "10s";
static_configs = [{ targets = [ "127.0.0.1:8100" ]; }];
metric_relabel_configs = [
{
source_labels = [ "__name__" ];
regex = ".*grpc_io.*";
action = "drop";
}
];
}
];
};
exporters = {
# provide prometheus sink under `/metrics` to
prometheus = {
endpoint = "127.0.0.1:8090";
};
};
service = {
pipelines.metrics = {
receivers = [ "influxdb" "prometheus" ];
exporters = [ "prometheus" ];
};
# open telemetries own metrics?
telemetry.metrics.address = "0.0.0.0:8100";
};
};
};
}

View file

@ -2,10 +2,15 @@
services.telegraf = { services.telegraf = {
enable = true; enable = true;
extraConfig = { extraConfig = {
outputs.prometheus_client = { outputs = {
prometheus_client = {
listen = ":9273"; listen = ":9273";
metric_version = 2; metric_version = 2;
}; };
influxdb_v2 = {
urls = [ "http://127.0.0.1:8088" ];
};
};
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins # https://github.com/influxdata/telegraf/tree/master/plugins/inputs < all them plugins
inputs = { inputs = {
cpu = { cpu = {