Skip to content

Commit

Permalink
Merge branch 'v1.11-diagrams' of https://github.com/hhunter-ms/docs i…
Browse files Browse the repository at this point in the history
…nto v1.11-diagrams
  • Loading branch information
hhunter-ms committed Oct 3, 2023
2 parents b0c9edd + 56d5c66 commit 9a1dd55
Show file tree
Hide file tree
Showing 7 changed files with 271 additions and 192 deletions.
187 changes: 0 additions & 187 deletions daprdocs/content/en/operations/observability/tracing/jaeger.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
type: docs
title: "Using OpenTelemetry Collector to collect traces to send to Jaeger"
linkTitle: "Using the OpenTelemetry for Jaeger"
weight: 1200
description: "How to push trace events to Jaeger distributed tracing platform, using the OpenTelemetry Collector."
type: docs
---

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).
{{< tabs Self-hosted Kubernetes >}}

{{% codetab %}}
<!-- self-hosted -->
## Configure Jaeger 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 \
-p 16686:16686 \
jaegertracing/all-in-one:1.49
```

Next, create the following `config.yaml` file locally:

> **Note:** Because you are using the Open Telemetry protocol to talk to Jaeger, you need to fill out the `otel` section of the tracing configuration and set the `endpointAddress` to the address of the Jaeger container.
```yaml
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: tracing
namespace: default
spec:
tracing:
samplingRate: "1"
stdout: true
otel:
endpointAddress: "localhost:4317"
isSecure: false
protocol: grpc
```
To launch the application referring to the new YAML configuration file, use
the `--config` option. For example:

```bash
dapr run --app-id myapp --app-port 3000 node app.js --config config.yaml
```

### View traces

To view traces in your browser, go to `http://localhost:16686` to see the Jaeger UI.
{{% /codetab %}}

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

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.

### 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.

1. Download and inspect the [`open-telemetry-collector-jaeger.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml) file.

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.

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

```sh
kubectl apply -f open-telemetry-collector-jaeger.yaml
```

### 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. 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:

```sh
kubectl apply -f collector-config.yaml
```

### Deploy your app with tracing enabled

Apply the `tracing` Dapr configuration by adding a `dapr.io/config` annotation to the application deployment that you want to enable distributed tracing for, as shown in the following example:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
...
spec:
...
template:
metadata:
...
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "MyApp"
dapr.io/app-port: "8080"
dapr.io/config: "tracing"
```

You can register multiple tracing exporters at the same time, and the tracing logs are forwarded to all registered exporters.

That’s it! There’s no need to include the OpenTelemetry SDK or instrument your application code. Dapr automatically handles the distributed tracing for you.

### View traces

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

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

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

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

{{< /tabs >}}
## 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)
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ weight: 900
description: "How to use Dapr to push trace events through the OpenTelemetry Collector."
---

Dapr directly writes traces using the OpenTelemetry (OTEL) protocol as the **recommended** method. For observability tools that support OTEL protocol, it is recommended to use the OpenTelemetry Collector, as it allows your application to quickly offload data and includes features, such as retries, batching, and encryption. For more information, read the Open Telemetry [documentation](https://opentelemetry.io/docs/collector/#when-to-use-a-collector).
Dapr directly writes traces using the OpenTelemetry (OTLP) protocol as the **recommended** method. For observability tools that support the OTLP directly, it is recommended to use the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector), as it allows your application to quickly offload data and includes features, such as retries, batching, and encryption. For more information, read the Open Telemetry Collector [documentation](https://opentelemetry.io/docs/collector/#when-to-use-a-collector).

Dapr can also write traces using the Zipkin protocol. Previous to supporting the OTEL protocol, you use the Zipkin protocol with the [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) to send traces to observability tools such as AWS X-Ray, Google Cloud Operations Suite, and Azure Monitor. Both protocol approaches are valid, however OTEL is the recommended choice.
Dapr can also write traces using the Zipkin protocol. Prior to supporting the OTLP protocol, the Zipkin protocol was used with the OpenTelemetry Collector to send traces to observability tools such as AWS X-Ray, Google Cloud Operations Suite, and Azure Monitor. Both protocol approaches are valid, however the OpenTelemetry protocol is the recommended choice.

![Using OpenTelemetry Collect to integrate with many backend](/images/open-telemetry-collector.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ turns on tracing for the sidecar.
Learn how to set up tracing with one of the following tools:
- [OTEL Collector]({{< ref otel-collector >}})
- [New Relic]({{< ref newrelic.md >}})
- [Jaeger]({{< ref jaeger.md >}})
- [Jaeger]({{< ref open-telemetry-collector-jaeger.md >}})
- [Zipkin]({{< ref zipkin.md >}})
- [Datadog]({{< ref datadog.md >}})
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ The above example uses secrets as plain strings. It is recommended to use a secr

| Field | Required | Details | Example |
|----------------------------|:--------:|---------|---------|
| connectionString | Y* | Connection String for the Azure App Configuration instance. No Default. Can be `secretKeyRef` to use a secret reference. *Mutally exclusive with host field. *Not to be used when [Azure Authentication](https://docs.dapr.io/developing-applications/integrations/azure/authenticating-azure/) is used | `Endpoint=https://foo.azconfig.io;Id=osOX-l9-s0:sig;Secret=00000000000000000000000000000000000000000000`
| host | N* | Endpoint for the Azure App Configuration instance. No Default. *Mutally exclusive with connectionString field. *To be used when [Azure Authentication](https://docs.dapr.io/developing-applications/integrations/azure/authenticating-azure/) is used | `https://dapr.azconfig.io`
| connectionString | Y* | Connection String for the Azure App Configuration instance. No Default. Can be `secretKeyRef` to use a secret reference. *Mutally exclusive with host field. *Not to be used when [Azure Authentication](https://docs.dapr.io/developing-applications/integrations/azure/azure-authentication/authenticating-azure/) is used | `Endpoint=https://foo.azconfig.io;Id=osOX-l9-s0:sig;Secret=00000000000000000000000000000000000000000000`
| host | N* | Endpoint for the Azure App Configuration instance. No Default. *Mutally exclusive with connectionString field. *To be used when [Azure Authentication](https://docs.dapr.io/developing-applications/integrations/azure/azure-authentication/authenticating-azure/) is used | `https://dapr.azconfig.io`
| maxRetries | N | Maximum number of retries before giving up. Defaults to `3` | `5`, `10`
| retryDelay | N | RetryDelay specifies the initial amount of delay to use before retrying an operation. The delay increases exponentially with each retry up to the maximum specified by MaxRetryDelay. Defaults to `4` seconds; `"-1"` disables delay between retries. | `4s`
| maxRetryDelay | N | MaxRetryDelay specifies the maximum delay allowed before retrying an operation. Typically the value is greater than or equal to the value specified in RetryDelay. Defaults to `120` seconds; `"-1"` disables the limit | `120s`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: tracing
namespace: default # Your app namespace
spec:
tracing:
samplingRate: "1"
stdout: true
otel:
endpointAddress: "otel-collector.default.svc.cluster.local:4317"
isSecure: false
protocol: grpc
Loading

0 comments on commit 9a1dd55

Please sign in to comment.