diff --git a/.env b/.env index f316d96050..c8264dd0a3 100644 --- a/.env +++ b/.env @@ -22,6 +22,7 @@ TRACETEST_IMAGE=kubeshop/tracetest:v1.3.0 ENV_PLATFORM=local # OpenTelemetry Collector +HOST_FILESYSTEM=/ DOCKER_SOCK=/var/run/docker.sock OTEL_COLLECTOR_HOST=otelcol OTEL_COLLECTOR_PORT_GRPC=4317 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e56e21187..36033f5b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ the release. ([#1666](https://github.com/open-telemetry/opentelemetry-demo/pull/1666)) * [frontend] Update nodejs to latest LTS and bump dependencies ([#1670](https://github.com/open-telemetry/opentelemetry-demo/pull/1670)) +* [otel-col] Add host metrics receiver + ([#1675](https://github.com/open-telemetry/opentelemetry-demo/pull/1675)) ## 1.11.0 diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index be766578ad..f10ad9470a 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -585,6 +585,7 @@ services: command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] user: 0:0 volumes: + - ${HOST_FILESYSTEM}:/hostfs:ro - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml @@ -596,6 +597,7 @@ services: logging: *logging environment: - ENVOY_PORT + - HOST_FILESYSTEM - OTEL_COLLECTOR_HOST - OTEL_COLLECTOR_PORT_GRPC - OTEL_COLLECTOR_PORT_HTTP diff --git a/docker-compose.yml b/docker-compose.yml index afa1c69dc6..e253cdc982 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -695,6 +695,7 @@ services: command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] user: 0:0 volumes: + - ${HOST_FILESYSTEM}:/hostfs:ro - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml @@ -706,6 +707,7 @@ services: logging: *logging environment: - ENVOY_PORT + - HOST_FILESYSTEM - OTEL_COLLECTOR_HOST - OTEL_COLLECTOR_PORT_GRPC - OTEL_COLLECTOR_PORT_HTTP diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index e58de595eb..e58a454cb6 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -21,6 +21,64 @@ receivers: endpoint: "valkey-cart:6379" username: "valkey" collection_interval: 10s + # Host metrics + hostmetrics: + root_path: /hostfs + scrapers: + cpu: + metrics: + system.cpu.utilization: + enabled: true + disk: + load: + filesystem: + exclude_mount_points: + mount_points: + - /dev/* + - /proc/* + - /sys/* + - /run/k3s/containerd/* + - /var/lib/docker/* + - /var/lib/kubelet/* + - /snap/* + match_type: regexp + exclude_fs_types: + fs_types: + - autofs + - binfmt_misc + - bpf + - cgroup2 + - configfs + - debugfs + - devpts + - devtmpfs + - fusectl + - hugetlbfs + - iso9660 + - mqueue + - nsfs + - overlay + - proc + - procfs + - pstore + - rpc_pipefs + - securityfs + - selinuxfs + - squashfs + - sysfs + - tracefs + match_type: strict + memory: + metrics: + system.memory.utilization: + enabled: true + network: + paging: + processes: + process: + mute_process_exe_error: true + mute_process_io_error: true + mute_process_user_error: true # Collector metrics prometheus: config: @@ -68,7 +126,7 @@ service: processors: [transform, batch] exporters: [otlp, debug, spanmetrics] metrics: - receivers: [docker_stats, httpcheck/frontendproxy, otlp, prometheus, redis, spanmetrics] + receivers: [hostmetrics, docker_stats, httpcheck/frontendproxy, otlp, prometheus, redis, spanmetrics] processors: [batch] exporters: [otlphttp/prometheus, debug] logs: