Skip to main content

Integrate OpenTelemetry Traces

What is OpenTelemetry?

OpenTelemetry is an open source, vendor- and tool-neutral project that provides a comprehensive observability framework for generating, exporting and collecting telemetry data, such as traces, metrics and logs. Visit the OpenTelemetry website for more information.

Integrating OpenTelemetry with Causely

You can export traces from an application or an existing OpenTelemetry Collector to the mediator that was installed as part of the Causely agent. The mediator listens for traces on port 4317 using the OpenTelemetry Protocol (OTLP).

We recommend using OpenTelemetry with Causely because traces enable automatic discovery of service dependencies and monitoring of both synchronous and asynchronous communication signals.

info

By default, Causely will use OpenTelemetry eBPF Instrumentation for automatic instrumentation of your applications.

How it works

The following diagram shows how OpenTelemetry traces are collected and forwarded to the Causely mediator. For more information on how Causely works, see the How Causely Works page.


Good to know

No raw data is sent from the mediator to the Causely engine, only distilled insights. This way your data is secure and you can be sure that no sensitive data is sent to us.

Quick Start Guide

If you don't have an OpenTelemetry Collector running in your Kubernetes cluster, you can use the following command to install the OpenTelemetry Operator and the OpenTelemetry Collector:

helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm install opentelemetry-collector open-telemetry/opentelemetry-collector --values ./opentelemetry-values.yaml

For values of opentelemetry-values.yaml see the OpenTelemetry Operator Configuration section below.

OpenTelemetry Collector Configuration

For an instance of the OpenTelemetry Collector running within your Kubernetes cluster, you can use the following configuration:

exporters:
otlp/causely:
endpoint: mediator.causely:4317
compression: none
tls:
insecure: true

processors:
batch:
timeout: 1s
k8sattributes:
auth_type: 'serviceAccount'
passthrough: false
extract:
metadata:
- k8s.pod.name
- k8s.pod.uid
- k8s.deployment.name
- k8s.namespace.name
- k8s.node.name
- k8s.pod.start_time
# Optional: Filter out internal spans
filter/ignore-internal:
error_mode: ignore
traces:
span:
- 'kind.string == Internal'

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318

service:
pipelines:
traces:
exporters: [otlp/causely]
processors: [filter/ignore-internal, k8sattributes, batch]
receivers: [otlp]

Configuration Breakdown

This configuration will:

OpenTelemetry Operator Configuration

If you are using the OpenTelemetry Operator for Kubernetes, you can use the following configuration:

# Valid values are "daemonset" and "deployment".
# If set, agentCollector and standaloneCollector are ignored.
mode: 'deployment'

config:
exporters:
otlp/causely:
endpoint: mediator.causely:4317
compression: none
tls:
insecure: true

processors:
batch:
timeout: 1s
k8sattributes:
auth_type: 'serviceAccount'
passthrough: false
extract:
metadata:
- k8s.pod.name
- k8s.pod.uid
- k8s.deployment.name
- k8s.namespace.name
- k8s.node.name
- k8s.pod.start_time

# Optional: Filter out internal spans
filter:
error_mode: ignore
traces:
span:
- 'kind.string == Internal'

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318

service:
pipelines:
traces:
exporters:
- otlp/causely
processors:
- filter
- k8sattributes
- batch
receivers:
- otlp

presets:
kubernetesAttributes:
enabled: true

podLabels:
sidecar.istio.io/inject: 'disabled'