From 115dbafd8b3ead0ea81d5115bb7dbc023703645d Mon Sep 17 00:00:00 2001 From: Scott Prutton Date: Wed, 7 Aug 2024 14:17:12 -0400 Subject: [PATCH] feat: add process-exporter to the stack to track firecracker metrics --- component/deploy/docker-compose.yaml | 22 ++++++++++++++++++++++ component/init/configs/proc-exporter.yml | 3 +++ component/init/configs/prometheus.yml | 15 +++++++++++++++ dev/Tiltfile | 3 ++- dev/docker-compose.platform.yml | 12 ++++++++++++ dev/process-exporter-config/config.yml | 3 +++ dev/prometheus-config/config.yml | 4 ++++ 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 component/init/configs/proc-exporter.yml create mode 100644 component/init/configs/prometheus.yml create mode 100644 dev/process-exporter-config/config.yml diff --git a/component/deploy/docker-compose.yaml b/component/deploy/docker-compose.yaml index 76cd90e921..e0631d9ab9 100644 --- a/component/deploy/docker-compose.yaml +++ b/component/deploy/docker-compose.yaml @@ -71,5 +71,27 @@ services: init: condition: service_completed_successfully + prometheus: + image: prom/prometheus + profiles: [rebaser, pinga, sdf, veritech] + ports: + - "9000:9090" + volumes: + - "config:/etc/prometheus/" + depends_on: + - otelcol + + process-exporter: + image: ncabatoff/process-exporter + profiles: [veritech] + command: + - '-procfs=/host/proc' + - '-config.path=/config/proc-exporter.yml' + ports: + - "9256:9256" + volumes: + - "config:/config/" + - /proc:/host/proc:ro + volumes: config: diff --git a/component/init/configs/proc-exporter.yml b/component/init/configs/proc-exporter.yml new file mode 100644 index 0000000000..42fa5ca4b0 --- /dev/null +++ b/component/init/configs/proc-exporter.yml @@ -0,0 +1,3 @@ +process_names: + - comm: + - firecracker diff --git a/component/init/configs/prometheus.yml b/component/init/configs/prometheus.yml new file mode 100644 index 0000000000..ad0a5fd220 --- /dev/null +++ b/component/init/configs/prometheus.yml @@ -0,0 +1,15 @@ +global: + scrape_interval: 100ms +scrape_configs: + - job_name: service_metrics + static_configs: + - targets: + - otelcol:9090 + - job_name: firecracker + static_configs: + - targets: + - process-exporter:9256 + - job_name: node-exporter + static_configs: + - targets: + - node-exporter:9100 diff --git a/dev/Tiltfile b/dev/Tiltfile index f6c9bb56e4..7e56e13bea 100644 --- a/dev/Tiltfile +++ b/dev/Tiltfile @@ -37,6 +37,7 @@ groups = { "promtail", "grafana", "loki", + "process-exporter", ], } @@ -109,7 +110,7 @@ def find_group(name, groups): # Use Docker Compose to provide the platform services docker_compose("./docker-compose.platform.yml") -compose_services = ["jaeger", "nats", "otelcol", "postgres", "postgres-test", "db", "db-test", "loki", "grafana", "localstack", "promtail", "prometheus"] +compose_services = ["jaeger", "nats", "otelcol", "postgres", "postgres-test", "db", "db-test", "loki", "grafana", "localstack", "promtail", "prometheus", "process-exporter"] for service in compose_services: if service == "jaeger": links = [ diff --git a/dev/docker-compose.platform.yml b/dev/docker-compose.platform.yml index 29471d10cb..cabefc4303 100644 --- a/dev/docker-compose.platform.yml +++ b/dev/docker-compose.platform.yml @@ -169,6 +169,18 @@ services: depends_on: - otelcol + process-exporter: + #<<: *loki-logged-service + image: ncabatoff/process-exporter + command: + - '-procfs=/host/proc' + - '-config.path=/config/config.yml' + ports: + - "9256:9256" + volumes: + - "./process-exporter-config/config.yml:/config/config.yml" + - "/proc:/host/proc:ro" + localstack: #<<: *loki-logged-service image: localstack/localstack diff --git a/dev/process-exporter-config/config.yml b/dev/process-exporter-config/config.yml new file mode 100644 index 0000000000..42fa5ca4b0 --- /dev/null +++ b/dev/process-exporter-config/config.yml @@ -0,0 +1,3 @@ +process_names: + - comm: + - firecracker diff --git a/dev/prometheus-config/config.yml b/dev/prometheus-config/config.yml index 10da846a7a..bbbc07b670 100644 --- a/dev/prometheus-config/config.yml +++ b/dev/prometheus-config/config.yml @@ -5,3 +5,7 @@ scrape_configs: static_configs: - targets: - otelcol:9090 + - job_name: firecracker + static_configs: + - targets: + - process-exporter:9256