When deploying OpenTelemetry Collector on a Docker Environment, refer to the following sample yaml. Note that kf_platform
with docker
as value is a required resource attribute. Also refer to OpenTelemetry Runtime Metrics for additional details regarding runtime metrics and Container Resource Attributes Collection for Telemetry Data for details on enabling container resource attributes.
Code Block |
---|
receivers: otlp: protocols: grpc: http: cors: allowed_origins: - "http://*" - "https://*" exporters: otlphttp: logs_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/v1/logs metrics_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/metrics traces_endpoint: https://<REPLACE WITH KFUSE ADDRESS>/ingester/otlp/traces processors: batch: timeout: 10s resource: attributes: - key: kf_platform value: "docker" action: upsert resourcedetection: detectors: - env - docker - ec2 - gcp - azure override: true timeout: 2s connectors: spanmetrics: service: pipelines: traces: receivers: [otlp] processors: [batch, resource, resourcedetection] exporters: [otlphttp] metrics: exporters: [otlphttp] processors: [batch, resource, resourcedetection] receivers: [otlp] logs: exporters: [otlphttp] processors: [batch, resource, resourcedetection] receivers: [otlp] |
...
Code Block |
---|
stat -c '%g' /var/run/docker.sock |
Docker and System Level Metrics
The Kfuse APM Services page integrates with docker and system metrics to show related infrastructure metrics.
...
The metrics can be exported into Kfuse using Datadog or from the OpenTelemetry collector itself.
If using Datadog to export these metrics, refer to Datadog Agent Installation using Docker-Compose
If using OpenTelemetry Collector, the OpenTelemetry Collector needs to be updated with additional configurations. Specifically, enable dockerstats
and hostmetrics
receivers, add additional kf_metrics_agent
resource attributes.
Code Block |
---|
receivers:
...
docker_stats:
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
memory:
metrics:
system.memory.utilization:
enabled: true
disk:
filesystem:
metrics:
system.filesystem.utilization:
enabled: true
processors:
batch:
timeout: 10s
resource:
attributes:
- key: kf_platform
value: "docker"
action: upsert
- key: kf_metrics_agent
value: "otlp"
action: upsert
resourcedetection:
detectors:
- env
- docker
- ec2
- gcp
override: true
timeout: 2s
service:
pipelines:
...
metrics:
exporters: [otlphttp]
processors: [batch, resource, resourcedetection]
receivers: [otlp, docker_stats, hostmetrics] |