opentelemetry-operator

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2020 License: Apache-2.0

README

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 https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/master/deploy/crds/opentelemetry.io_opentelemetrycollectors_crd.yaml
kubectl create -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/master/deploy/service_account.yaml
kubectl create -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/master/deploy/role.yaml
kubectl create -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/master/deploy/role_binding.yaml
kubectl create -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-operator/master/deploy/operator.yaml

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

$ kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
  name: simplest
spec:
  image: otel/opentelemetry-collector:latest
  config: |
    receivers:
      jaeger:
        protocols:
          grpc:
    processors:
      queued_retry:

    exporters:
      logging:

    service:
      pipelines:
        traces:
          receivers: [jaeger]
          processors: [queued_retry]
          exporters: [logging]
EOF

WARNING: Until the OpenTelemetry Collector format is stable, changes may be required in the above example to remain compatible with the latest version of the OpenTelemetry Collector image being referenced.

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 https://raw.githubusercontent.com/coreos/prometheus-operator/v0.33.0/bundle.yaml

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 CONTRIBUTING.md.

License

Apache 2.0 License.

Directories

Path Synopsis
cmd
manager command
pkg
apis/opentelemetry/v1alpha1
Package v1alpha1 contains API Schema definitions for the opentelemetry v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=opentelemetry.io Package v1alpha1 contains API Schema definitions for the opentelemetry v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=opentelemetry.io
Package v1alpha1 contains API Schema definitions for the opentelemetry v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=opentelemetry.io Package v1alpha1 contains API Schema definitions for the opentelemetry v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=opentelemetry.io
client/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/versioned/typed/opentelemetry/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/versioned/typed/opentelemetry/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL