Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
---
type: docs
title: "Using OpenTelemetry Collector to collect traces to send to Jaeger"
linkTitle: "Using the OpenTelemetry for Jaeger"
title: "Using OpenTelemetry to send traces to Jaeger V2"
linkTitle: "Using OpenTelemetry for Jaeger V2"
weight: 1200
description: "How to push trace events to Jaeger distributed tracing platform, using the OpenTelemetry Collector."
description: "How to push trace events to Jaeger V2 distributed tracing platform using OpenTelemetry protocol."
---

While Dapr supports writing traces using OpenTelemetry (OTLP) and Zipkin protocols, Zipkin support for Jaeger has been deprecated in favor of OTLP. Although Jaeger supports OTLP directly, the recommended approach for production is to use the OpenTelemetry Collector to collect traces from Dapr and send them to Jaeger, allowing your application to quickly offload data and take advantage of features like retries, batching, and encryption. For more information, read the Open Telemetry Collector [documentation](https://opentelemetry.io/docs/collector/#when-to-use-a-collector).
Dapr supports writing traces using the OpenTelemetry (OTLP) protocol, and Jaeger V2 natively supports OTLP, allowing Dapr to send traces directly to a Jaeger V2 instance. This approach is recommended for production to leverage Jaeger V2's capabilities for distributed tracing.

{{< tabpane text=true >}}

{{% tab "Self-hosted" %}}
<!-- self-hosted -->
## Configure Jaeger in self-hosted mode
## Configure Jaeger V2 in self-hosted mode

### Local setup

The simplest way to start Jaeger is to run the pre-built, all-in-one Jaeger image published to DockerHub and expose the OTLP port:

```bash
docker run -d --name jaeger \
-p 4317:4317 \
docker run --rm --name jaeger \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest two updates here.

  • Add that -p 9411:9411 clashes with zipkin that may already be running and you should stop zipkin first with a docker stop command

  • Add the -d command so this runs detached in the background. Like this

docker run -d --rm --name jaeger \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 5778:5778 \
  -p 9411:9411 \
  cr.jaegertracing.io/jaegertracing/jaeger:2.11.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make a new PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-p 16686:16686 \
jaegertracing/all-in-one:1.49
-p 4317:4317 \
-p 4318:4318 \
-p 5778:5778 \
-p 9411:9411 \
cr.jaegertracing.io/jaegertracing/jaeger:2.11.0
```

Next, create the following `config.yaml` file locally:
Expand Down Expand Up @@ -58,41 +61,103 @@ To view traces in your browser, go to `http://localhost:16686` to see the Jaeger

{{% tab "Kubernetes" %}}
<!-- kubernetes -->
## Configure Jaeger on Kubernetes with the OpenTelemetry Collector
## Configure Jaeger V2 on Kubernetes

The following steps show you how to configure Dapr to send distributed tracing data to the OpenTelemetry Collector which, in turn, sends the traces to Jaeger.
The following steps show you how to configure Dapr to send distributed tracing data directly to a Jaeger V2 instance deployed using the OpenTelemetry Operator with in-memory storage.

### Prerequisites

- [Install Dapr on Kubernetes]({{% ref kubernetes %}})
- [Set up Jaeger](https://www.jaegertracing.io/docs/1.49/operator/) using the Jaeger Kubernetes Operator

### Set up OpenTelemetry Collector to push to Jaeger

To push traces to your Jaeger instance, install the OpenTelemetry Collector on your Kubernetes cluster.
### Set up Jaeger V2 with the OpenTelemetry Operator

1. Download and inspect the [`open-telemetry-collector-jaeger.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml) file.
Jaeger V2 can be deployed using the OpenTelemetry Operator for simplified management and native OTLP support. The following example configures Jaeger V2 with in-memory storage.

1. In the data section of the `otel-collector-conf` ConfigMap, update the `otlp/jaeger.endpoint` value to reflect the endpoint of your Jaeger collector Kubernetes service object.
> **Note on Storage Backends:** This example uses in-memory storage (`memstore`) for simplicity, suitable for development or testing environments as it stores up to 100,000 traces in memory. For production environments, consider configuring a persistent storage backend like Cassandra or Elasticsearch to ensure trace data durability.

1. Deploy the OpenTelemetry Collector into the same namespace where your Dapr-enabled applications are running:
#### Installation

```sh
kubectl apply -f open-telemetry-collector-jaeger.yaml
1. **Install cert-manager** to manage certificates:
```bash
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.19.1/cert-manager.yaml -n cert-manager
```
Verify that all resources in the `cert-manager` namespace are ready.

### Set up Dapr to send traces to OpenTelemetryCollector

Create a Dapr configuration file to enable tracing and export the sidecar traces to the OpenTelemetry Collector.

1. Use the [`collector-config-otel.yaml`](/docs/open-telemetry-collector/collector-config-otel.yaml) file to create your own Dapr configuration.
1. **Install the OpenTelemetry Operator**:
```bash
kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml
```
Confirm that all resources in the `opentelemetry-operator-system` namespace are ready.

1. **Deploy a Jaeger V2 instance with in-memory storage**:
Apply the following configuration to create a Jaeger V2 instance:
```yaml
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: jaeger-inmemory-instance
namespace: observability
spec:
image: jaegertracing/jaeger:latest
ports:
- name: jaeger
port: 16686
config:
service:
extensions: [jaeger_storage, jaeger_query]
pipelines:
traces:
receivers: [otlp]
exporters: [jaeger_storage_exporter]
extensions:
jaeger_query:
storage:
traces: memstore
jaeger_storage:
backends:
memstore:
memory:
max_traces: 100000
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
jaeger_storage_exporter:
trace_storage: memstore
```
Apply it with:
```bash
kubectl apply -f jaeger-inmemory.yaml -n observability
```

1. Update the `namespace` and `otel.endpointAddress` values to align with the namespace where your Dapr-enabled applications and OpenTelemetry Collector are deployed.

1. Apply the configuration with:
### Set up Dapr to send traces to Jaeger V2

Create a Dapr configuration file to enable tracing and export the sidecar traces directly to the Jaeger V2 instance.

1. Create a configuration file (e.g., `tracing.yaml`) with the following content, updating the `namespace` and `otel.endpointAddress` to match your Jaeger V2 instance:
```yaml
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: tracing
namespace: order-system
spec:
tracing:
samplingRate: "1"
otel:
endpointAddress: "jaeger-inmemory-instance-collector.observability.svc.cluster.local:4317"
isSecure: false
protocol: grpc
```

```sh
kubectl apply -f collector-config.yaml
2. Apply the configuration:
```bash
kubectl apply -f tracing.yaml -n order-system
```

### Deploy your app with tracing enabled
Expand Down Expand Up @@ -122,20 +187,20 @@ That’s it! There’s no need to include the OpenTelemetry SDK or instrument yo

### View traces

To view Dapr sidecar traces, port-forward the Jaeger Service and open the UI:
To view Dapr sidecar traces, port-forward the Jaeger V2 service and open the UI:

```bash
kubectl port-forward svc/jaeger-query 16686 -n observability
kubectl port-forward svc/jaeger-inmemory-instance-collector 16686 -n observability
```

In your browser, go to `http://localhost:16686` and you will see the Jaeger UI.
In your browser, go to `http://localhost:16686` to see the Jaeger V2 UI.

![jaeger](/images/jaeger_ui.png)
{{% /tab %}}

{{< /tabpane >}}

## References

- [Jaeger Getting Started](https://www.jaegertracing.io/docs/1.49/getting-started/)
- [Jaeger Kubernetes Operator](https://www.jaegertracing.io/docs/1.49/operator/)
- [OpenTelemetry Collector Exporters](https://opentelemetry.io/docs/collector/configuration/#exporters)
- [Jaeger V2 Getting Started](https://www.jaegertracing.io/docs/2.11/getting-started/)
- [Jaeger V2 Kubernetes Operator](https://www.jaegertracing.io/docs/2.11/deployment/kubernetes/#kubernetes-operator)
Loading