Quick Guide for OTel Agent on Kubernetes for Logs
The OpenTelemetry Collector can be deployed on Kubernetes to collect and export logs, metrics, and traces to Kloudfuse. This guide provides a sample configuration file that you can use as a reference for your deployment, with instructions for setting the correct protocol based on whether TLS is enabled or disabled 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
logs_endpoint: https://<REPLACE KFUSE ADDRESS>/ingester/otlp/v1/logs
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:
logs:
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