Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[otel-col] Add host metrics receiver #1675

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
- ${DOCKER_SOCK}:/var/run/docker.sock:ro
- ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml
- ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml
Expand All @@ -596,6 +597,7 @@ services:
logging: *logging
environment:
- ENVOY_PORT
- HOST_FILESYSTEM
- OTEL_COLLECTOR_HOST
- OTEL_COLLECTOR_PORT_GRPC
- OTEL_COLLECTOR_PORT_HTTP
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -706,6 +707,7 @@ services:
logging: *logging
environment:
- ENVOY_PORT
- HOST_FILESYSTEM
- OTEL_COLLECTOR_HOST
- OTEL_COLLECTOR_PORT_GRPC
- OTEL_COLLECTOR_PORT_HTTP
Expand Down
54 changes: 53 additions & 1 deletion src/otelcollector/otelcol-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,58 @@ receivers:
endpoint: "valkey-cart:6379"
username: "valkey"
collection_interval: 10s
# Host metrics
hostmetrics:
root_path: /hostfs
scrapers:
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
cpu:
rogercoll marked this conversation as resolved.
Show resolved Hide resolved
disk:
load:
filesystem:
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
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:
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
network:
paging:
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
processes:
process:
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
mute_process_exe_error: true
mute_process_io_error: true
mute_process_user_error: true
julianocosta89 marked this conversation as resolved.
Show resolved Hide resolved
# Collector metrics
prometheus:
config:
Expand Down Expand Up @@ -68,7 +120,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:
Expand Down
Loading