|  | 
| 1 | 1 | --- | 
| 2 | 2 | type: docs | 
| 3 |  | -title: "Using OpenTelemetry Collector to collect traces to send to Jaeger" | 
| 4 |  | -linkTitle: "Using the OpenTelemetry for Jaeger" | 
|  | 3 | +title: "Using OpenTelemetry to send traces to Jaeger V2" | 
|  | 4 | +linkTitle: "Using OpenTelemetry for Jaeger V2" | 
| 5 | 5 | weight: 1200 | 
| 6 |  | -description: "How to push trace events to Jaeger distributed tracing platform, using the OpenTelemetry Collector." | 
|  | 6 | +description: "How to push trace events to Jaeger V2 distributed tracing platform using OpenTelemetry protocol." | 
| 7 | 7 | --- | 
| 8 | 8 | 
 | 
| 9 |  | -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). | 
|  | 9 | +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. | 
|  | 10 | + | 
| 10 | 11 | {{< tabpane text=true >}} | 
| 11 | 12 | 
 | 
| 12 | 13 | {{% tab "Self-hosted" %}} | 
| 13 |  | -<!-- self-hosted --> | 
| 14 |  | -## Configure Jaeger in self-hosted mode | 
|  | 14 | +## Configure Jaeger V2 in self-hosted mode | 
| 15 | 15 | 
 | 
| 16 | 16 | ### Local setup | 
| 17 | 17 | 
 | 
| 18 | 18 | 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: | 
| 19 | 19 | 
 | 
| 20 | 20 | ```bash | 
| 21 |  | -docker run -d --name jaeger \ | 
| 22 |  | -  -p 4317:4317  \ | 
|  | 21 | +docker run --rm --name jaeger \ | 
| 23 | 22 |   -p 16686:16686 \ | 
| 24 |  | -  jaegertracing/all-in-one:1.49 | 
|  | 23 | +  -p 4317:4317 \ | 
|  | 24 | +  -p 4318:4318 \ | 
|  | 25 | +  -p 5778:5778 \ | 
|  | 26 | +  -p 9411:9411 \ | 
|  | 27 | +  cr.jaegertracing.io/jaegertracing/jaeger:2.11.0 | 
| 25 | 28 | ``` | 
| 26 | 29 | 
 | 
| 27 | 30 | Next, create the following `config.yaml` file locally: | 
| @@ -58,41 +61,103 @@ To view traces in your browser, go to `http://localhost:16686` to see the Jaeger | 
| 58 | 61 | 
 | 
| 59 | 62 | {{% tab "Kubernetes" %}} | 
| 60 | 63 | <!-- kubernetes --> | 
| 61 |  | -## Configure Jaeger on Kubernetes with the OpenTelemetry Collector | 
|  | 64 | +## Configure Jaeger V2 on Kubernetes | 
| 62 | 65 | 
 | 
| 63 |  | -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. | 
|  | 66 | +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. | 
| 64 | 67 | 
 | 
| 65 | 68 | ### Prerequisites | 
| 66 | 69 | 
 | 
| 67 | 70 | - [Install Dapr on Kubernetes]({{% ref kubernetes %}}) | 
| 68 |  | -- [Set up Jaeger](https://www.jaegertracing.io/docs/1.49/operator/) using the Jaeger Kubernetes Operator | 
| 69 |  | - | 
| 70 |  | -### Set up OpenTelemetry Collector to push to Jaeger | 
| 71 | 71 | 
 | 
| 72 |  | -To push traces to your Jaeger instance, install the OpenTelemetry Collector on your Kubernetes cluster. | 
|  | 72 | +### Set up Jaeger V2 with the OpenTelemetry Operator | 
| 73 | 73 | 
 | 
| 74 |  | -1. Download and inspect the [`open-telemetry-collector-jaeger.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml) file. | 
|  | 74 | +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. | 
| 75 | 75 | 
 | 
| 76 |  | -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. | 
|  | 76 | +> **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. | 
| 77 | 77 | 
 | 
| 78 |  | -1. Deploy the OpenTelemetry Collector into the same namespace where your Dapr-enabled applications are running: | 
|  | 78 | +#### Installation | 
| 79 | 79 | 
 | 
| 80 |  | -   ```sh | 
| 81 |  | -   kubectl apply -f open-telemetry-collector-jaeger.yaml | 
|  | 80 | +1. **Install cert-manager** to manage certificates: | 
|  | 81 | +   ```bash | 
|  | 82 | +   kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.19.1/cert-manager.yaml -n cert-manager | 
| 82 | 83 |    ``` | 
|  | 84 | +   Verify that all resources in the `cert-manager` namespace are ready. | 
| 83 | 85 | 
 | 
| 84 |  | -### Set up Dapr to send traces to OpenTelemetryCollector | 
| 85 |  | - | 
| 86 |  | -Create a Dapr configuration file to enable tracing and export the sidecar traces to the OpenTelemetry Collector. | 
| 87 |  | - | 
| 88 |  | -1. Use the [`collector-config-otel.yaml`](/docs/open-telemetry-collector/collector-config-otel.yaml) file to create your own Dapr configuration. | 
|  | 86 | +1. **Install the OpenTelemetry Operator**: | 
|  | 87 | +   ```bash | 
|  | 88 | +   kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml | 
|  | 89 | +   ``` | 
|  | 90 | +   Confirm that all resources in the `opentelemetry-operator-system` namespace are ready. | 
|  | 91 | + | 
|  | 92 | +1. **Deploy a Jaeger V2 instance with in-memory storage**: | 
|  | 93 | +   Apply the following configuration to create a Jaeger V2 instance: | 
|  | 94 | +   ```yaml | 
|  | 95 | +   apiVersion: opentelemetry.io/v1beta1 | 
|  | 96 | +   kind: OpenTelemetryCollector | 
|  | 97 | +   metadata: | 
|  | 98 | +     name: jaeger-inmemory-instance | 
|  | 99 | +     namespace: observability | 
|  | 100 | +   spec: | 
|  | 101 | +     image: jaegertracing/jaeger:latest | 
|  | 102 | +     ports: | 
|  | 103 | +     - name: jaeger | 
|  | 104 | +       port: 16686 | 
|  | 105 | +     config: | 
|  | 106 | +       service: | 
|  | 107 | +         extensions: [jaeger_storage, jaeger_query] | 
|  | 108 | +         pipelines: | 
|  | 109 | +           traces: | 
|  | 110 | +             receivers: [otlp] | 
|  | 111 | +             exporters: [jaeger_storage_exporter] | 
|  | 112 | +       extensions: | 
|  | 113 | +         jaeger_query: | 
|  | 114 | +           storage: | 
|  | 115 | +             traces: memstore | 
|  | 116 | +         jaeger_storage: | 
|  | 117 | +           backends: | 
|  | 118 | +             memstore: | 
|  | 119 | +               memory: | 
|  | 120 | +                 max_traces: 100000 | 
|  | 121 | +       receivers: | 
|  | 122 | +         otlp: | 
|  | 123 | +           protocols: | 
|  | 124 | +             grpc: | 
|  | 125 | +               endpoint: 0.0.0.0:4317 | 
|  | 126 | +             http: | 
|  | 127 | +               endpoint: 0.0.0.0:4318 | 
|  | 128 | +       exporters: | 
|  | 129 | +         jaeger_storage_exporter: | 
|  | 130 | +           trace_storage: memstore | 
|  | 131 | +   ``` | 
|  | 132 | +   Apply it with: | 
|  | 133 | +   ```bash | 
|  | 134 | +   kubectl apply -f jaeger-inmemory.yaml -n observability | 
|  | 135 | +   ``` | 
| 89 | 136 | 
 | 
| 90 |  | -1. Update the `namespace` and `otel.endpointAddress` values to align with the namespace where your Dapr-enabled applications and OpenTelemetry Collector are deployed. | 
| 91 | 137 | 
 | 
| 92 |  | -1. Apply the configuration with: | 
|  | 138 | +### Set up Dapr to send traces to Jaeger V2 | 
|  | 139 | + | 
|  | 140 | +Create a Dapr configuration file to enable tracing and export the sidecar traces directly to the Jaeger V2 instance. | 
|  | 141 | + | 
|  | 142 | +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: | 
|  | 143 | +   ```yaml | 
|  | 144 | +   apiVersion: dapr.io/v1alpha1 | 
|  | 145 | +   kind: Configuration | 
|  | 146 | +   metadata: | 
|  | 147 | +     name: tracing | 
|  | 148 | +     namespace: order-system | 
|  | 149 | +   spec: | 
|  | 150 | +     tracing: | 
|  | 151 | +       samplingRate: "1" | 
|  | 152 | +       otel: | 
|  | 153 | +         endpointAddress: "jaeger-inmemory-instance-collector.observability.svc.cluster.local:4317" | 
|  | 154 | +         isSecure: false | 
|  | 155 | +         protocol: grpc | 
|  | 156 | +   ``` | 
| 93 | 157 | 
 | 
| 94 |  | -   ```sh | 
| 95 |  | -   kubectl apply -f collector-config.yaml | 
|  | 158 | +2. Apply the configuration: | 
|  | 159 | +   ```bash | 
|  | 160 | +   kubectl apply -f tracing.yaml -n order-system | 
| 96 | 161 |    ``` | 
| 97 | 162 | 
 | 
| 98 | 163 | ### Deploy your app with tracing enabled | 
| @@ -122,20 +187,20 @@ That’s it! There’s no need to include the OpenTelemetry SDK or instrument yo | 
| 122 | 187 | 
 | 
| 123 | 188 | ### View traces | 
| 124 | 189 | 
 | 
| 125 |  | -To view Dapr sidecar traces, port-forward the Jaeger Service and open the UI: | 
|  | 190 | +To view Dapr sidecar traces, port-forward the Jaeger V2 service and open the UI: | 
| 126 | 191 | 
 | 
| 127 | 192 | ```bash | 
| 128 |  | -kubectl port-forward svc/jaeger-query 16686 -n observability | 
|  | 193 | +kubectl port-forward svc/jaeger-inmemory-instance-collector 16686 -n observability | 
| 129 | 194 | ``` | 
| 130 | 195 | 
 | 
| 131 |  | -In your browser, go to `http://localhost:16686` and you will see the Jaeger UI. | 
|  | 196 | +In your browser, go to `http://localhost:16686` to see the Jaeger V2 UI. | 
| 132 | 197 | 
 | 
| 133 | 198 |  | 
| 134 | 199 | {{% /tab %}} | 
| 135 | 200 | 
 | 
| 136 | 201 | {{< /tabpane >}} | 
|  | 202 | + | 
| 137 | 203 | ## References | 
| 138 | 204 | 
 | 
| 139 |  | -- [Jaeger Getting Started](https://www.jaegertracing.io/docs/1.49/getting-started/) | 
| 140 |  | -- [Jaeger Kubernetes Operator](https://www.jaegertracing.io/docs/1.49/operator/) | 
| 141 |  | -- [OpenTelemetry Collector Exporters](https://opentelemetry.io/docs/collector/configuration/#exporters) | 
|  | 205 | +- [Jaeger V2 Getting Started](https://www.jaegertracing.io/docs/2.11/getting-started/) | 
|  | 206 | +- [Jaeger V2 Kubernetes Operator](https://www.jaegertracing.io/docs/2.11/deployment/kubernetes/#kubernetes-operator) | 
0 commit comments