Skip to content
Kubernetes Operator for OpenTelemetry Collector
Go Shell Makefile Dockerfile
Branch: master
Clone or download

Continuous Integration Go Report Card GoDoc Maintainability codecov Repository on Quay

OpenTelemetry Operator for Kubernetes

The OpenTelemetry Operator is an implementation of a Kubernetes Operator.

At this point, it has OpenTelemetry Collector as the only managed component.

Getting started

To install the operator, run:

kubectl create -f
kubectl create -f
kubectl create -f
kubectl create -f
kubectl create -f

Once the opentelemetry-operator deployment is ready, create an OpenTelemetry Collector (otelcol) instance, like:

$ kubectl apply -f - <<EOF
kind: OpenTelemetryCollector
  name: simplest
  config: |



          receivers: [jaeger]
          processors: [queued_retry]
          exporters: [logging]

This will create an OpenTelemetry Collector instance named simplest, exposing a jaeger-grpc port to consume spans from your instrumented applications and exporting those spans via logging, which writes the spans to the console (stdout) of the OpenTelemetry Collector instance that receives the span.

The config node holds the YAML that should be passed down as-is to the underlying OpenTelemetry Collector instances. Refer to the OpenTelemetry Collector documentation for a reference of the possible entries.

At this point, the Operator does not validate the contents of the configuration file: if the configuration is invalid, the instance will still be created but the underlying OpenTelemetry Collector might crash.

Deployment modes

The CustomResource for the OpenTelemetryCollector exposes a property named .Spec.Mode, which can be used to specify whether the collector should run as a DaemonSet or as a Deployment (default). Look at the examples/daemonset.yaml for reference.

Prometheus ServiceMonitor objects

When the Prometheus Operator is available in the same cluster as the OpenTelemetry Operator, the OpenTelemetry Operator will automatically create the relevant ServiceMonitor objects:

  • One set for the OpenTelemetry Operator itself
  • One set for each managed OpenTelemetry instance

Refer to the Prometheus Operator for complete instructions on how to do a production-quality installation. For development purposes, the following will do:

$ kubectl apply -f

When deploying the example simplest.yaml, the following ServiceMonitor will be created once the Prometheus Operator is available:

$ kubectl get servicemonitors simplest-collector
NAME                 AGE
simplest-collector   103s

Contributing and Developing

Please see


Apache 2.0 License.

You can’t perform that action at this time.