Quick Guide for OTel Agent on Kubernetes for Metrics
The OpenTelemetry Collector on Kubernetes allows you to collect and export metrics, logs, and traces from your cluster to Kloudfuse for monitoring and analysis. This guide provides a sample configuration file that you can use as a starting point, with specific attention to setting the correct protocol depending on whether TLS is enabled in your environment.
Use the following sample helm-values.yaml file to configure the OpenTelemetry Collector to export logs, metrics, and traces to Kloudfuse. Ensure that you correctly set the protocol as either https or http, based on TLS being enabled or disabled.
image:
repository: "otel/opentelemetry-collector-contrib"
config:
exporters:
debug:
verbosity: basic
otlphttp:
tls:
insecure: true # add only if you're using insecure communication
metrics_endpoint: https://<REPLACE KFUSE ADDRESS>/ingester/otlp/metrics
extensions:
health_check: {}
memory_ballast:
size_in_percentage: 40
processors:
batch:
timeout: 10s
resourcedetection:
detectors:
- env
- eks
- ec2
- gcp
- aks
- azure
override: false
timeout: 2s
receivers:
otlp:
protocols:
grpc:
endpoint: ${env:MY_POD_IP}:4317
http:
cors:
allowed_origins:
- http://*
- https://*
endpoint: 0.0.0.0:4318
service:
extensions:
- health_check
pipelines:
metrics:
exporters:
- otlphttp
processors:
- batch
- k8sattributes
- resourcedetection
receivers:
- otlp
telemetry:
metrics:
address: ${MY_POD_IP}:8888
mode: daemonset
service:
enabled: true
nameOverride: otelcol
ports:
metrics:
enabled: true
otlp:
enabled: true
otlp-http:
enabled: true
presets:
kubernetesAttributes:
enabled: true
resources: {}
yaml