Oreon IT Helm charts / otel-collector-baseline

otel-collector-baseline Helm chart

Version 0.1.4 · app 0.1.0 · MIT · source · Artifact Hub

The OpenTelemetry Collector layout we run on client clusters, as values for the OpenTelemetry Operator. The operator does the deploying; this chart says what the collectors are and what they do.

pods ──OTLP──▶ agent (DaemonSet, one per node)        ──OTLP──▶ gateway (Deployment)         ──▶ backends
               otlp, kubeletstats, hostmetrics, filelog           drop health checks, redact,       OTLP / OTLP-HTTP
               k8sattributes, resourcedetection, resource         tail sampling, batch               Google Cloud
               memory_limiter, batch                                                                 Prometheus remote write
                                                                                                     Datadog, Elasticsearch

With no backend enabled everything goes to the debug exporter, so a fresh install shows data moving in the gateway log before you commit to a destination.

Install

helm repo add oreonit https://oreondev.github.io/helm-charts
helm install otel oreonit/otel-collector-baseline -n observability --create-namespace -f otel.yaml

otel.yaml, Grafana Cloud over OTLP:

clusterName: prod-eu
environment: production

gateway:
  env:
    - name: GRAFANA_CLOUD_AUTH          # base64 of "<instance id>:<token>"
      valueFrom: {secretKeyRef: {name: grafana-cloud, key: auth}}

backends:
  otlphttp:
    enabled: true
    endpoint: https://otlp-gateway-prod-eu-west-2.grafana.net/otlp
    headers:
      Authorization: "Basic ${env:GRAFANA_CLOUD_AUTH}"

processing:
  tailSampling:
    enabled: true
    percentage: 10

instrumentation:
  enabled: true

monitoring:
  enabled: true
  labels:
    release: kube-prometheus-stack

Google Cloud (Cloud Trace, Cloud Logging, Managed Service for Prometheus) with Workload Identity on the gateway's ServiceAccount:

clusterName: prod-gke
image: otel/opentelemetry-collector-contrib:0.163.2     # contrib carries the Google exporters
agent:
  receivers:
    filelog:
      enabled: false                                     # GKE already ships container logs
  resourceDetectors: [env, gcp]
backends:
  googlecloud:
    enabled: true
  googlemanagedprometheus:
    enabled: true

Then instrument an app without touching its image:

kubectl -n shop patch deployment checkout -p \
  '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-java":"observability/otel"}}}}}'

Check:

kubectl -n observability get opentelemetrycollectors
kubectl -n observability logs deploy/otel-gateway-collector --tail=50

Values

Key Default Description
clusterName "" (required) k8s.cluster.name on everything
environment "" deployment.environment.name
image "" Collector image; empty = operator default. Contrib needed for Google, Datadog, Elasticsearch
telemetry.{metricsPort,level,logLevel,readers} 8888 / normal / info / true Collector self-telemetry; readers: false for collectors older than 0.123
agent.enabled true Node agent DaemonSet
agent.receivers.otlp.enabled true OTLP gRPC 4317 and HTTP 4318
agent.receivers.kubeletstats.* on, 30s, node/pod/container/volume Kubelet metrics
agent.receivers.hostmetrics.* on, 30s, cpu/memory/disk/filesystem/load/network Host metrics from /hostfs
agent.receivers.filelog.* on, checkpointed at /var/lib/otelcol/filelog Container logs; excludeNamespaces, startAt
agent.k8sattributes.{extractMetadata,extractLabels,extractAnnotations} see values.yaml Kubernetes metadata and label/annotation copies
agent.resourceDetectors [env] Add gcp, eks, ec2, aks, azure
agent.{memoryLimiter,batch,resources,tolerations,nodeSelector,priorityClassName,podAnnotations,securityContext,env,extraVolumes,extraVolumeMounts} Workload settings; tolerates every taint by default
agent.extraConfig / agent.extraSpec {} Deep-merged into the collector config / the OpenTelemetryCollector spec
gateway.enabled true Gateway Deployment; off = the agent exports straight to the backends
gateway.{replicas,autoscaler,podDisruptionBudget} 2 / off / minAvailable 1 Scale and availability
gateway.{memoryLimiter,batch,resources,tolerations,nodeSelector,affinity,topologySpreadConstraints,priorityClassName,podAnnotations,env,extraVolumes,extraVolumeMounts,extraConfig,extraSpec} Workload settings; env carries the backend secrets
processing.dropHealthChecks.{enabled,paths} on, /healthz /readyz /livez /health /ready /live /metrics /ping Filter spans by url.path, http.route, http.target
processing.tailSampling.{enabled,decisionWait,numTraces,errorsAlways,slowMs,percentage,extraPolicies} off, 10s, 100000, true, 2000, 10 Tail sampling in the gateway
processing.redact.{enabled,attributes,patterns} on, auth/cookie/api-key headers Attributes deleted from spans and logs
processing.resourceAttributes {} Extra resource attributes on everything
backends.otlp / backends.otlphttp off endpoint, headers, tls, compression, signals
backends.googlecloud off project, signals (traces, logs)
backends.googlemanagedprometheus off project; metrics
backends.prometheusremotewrite off endpoint, headers, tls, resourceToTelemetryConversion; metrics
backends.datadog off site, apiKey, signals
backends.elasticsearch off endpoints, apiKey, mappingMode, tls, signals
backends.debug off verbosity, signals
instrumentation.{enabled,name,namespace,endpoint,propagators,sampler,resourceAttributes,env,java,nodejs,python,dotnet,go} off Instrumentation object
monitoring.{enabled,labels,serviceMonitor,prometheusRule,dashboard,alerts} off Prometheus Operator and Grafana sidecar integration

Notes

The agent and gateway split, the sampling policy and the redaction list are the shape we describe in 10 observability metrics every DevOps engineer should track and how to avoid alert fatigue. If you would like the pipeline designed around your backends and budget, see our observability consulting.

Licence

MIT. Maintained by Oreon IT.

Oreon IT

Maintained by Oreon IT

A London cloud, DevOps and SRE consultancy. If you want this chart rolled out and tuned for your platform, we can help.