Skip to content

Commit 9faf5ae

Browse files
Azure Application Insights fixes (#4660)
Signed-off-by: Alice Gibbons <[email protected]>
1 parent 4638f8f commit 9faf5ae

File tree

5 files changed

+35
-26
lines changed

5 files changed

+35
-26
lines changed

daprdocs/content/en/operations/observability/tracing/otel-collector/open-telemetry-collector-appinsights.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,42 @@ weight: 1000
66
description: "How to push trace events to Azure Application Insights, using the OpenTelemetry Collector."
77
---
88

9-
Dapr integrates with [OpenTelemetry (OTEL) Collector](https://github.com/open-telemetry/opentelemetry-collector) using the Zipkin API. This guide walks through an example using Dapr to push trace events to Azure Application Insights, using the OpenTelemetry Collector.
9+
Dapr integrates with [OpenTelemetry (OTEL) Collector](https://github.com/open-telemetry/opentelemetry-collector) using the OpenTelemetry protocol (OTLP). This guide walks through an example using Dapr to push traces to Azure Application Insights, using the OpenTelemetry Collector.
1010

1111
## Prerequisites
1212

1313
- [Install Dapr on Kubernetes]({{< ref kubernetes >}})
14-
- [Set up an App Insights resource](https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource) and make note of your App Insights connection string.
14+
- [Create an Application Insights resource](https://learn.microsoft.com/azure/azure-monitor/app/create-workspace-resource) and make note of your Application Insights connection string.
1515

1616
## Set up OTEL Collector to push to your App Insights instance
1717

18-
To push events to your App Insights instance, install the OTEL Collector to your Kubernetes cluster.
18+
To push traces to your Application Insights instance, install the OpenTelemetry Collector on your Kubernetes cluster.
1919

20-
1. Check out the [`open-telemetry-collector-appinsights.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml) file.
20+
1. Download and inspect the [`open-telemetry-collector-appinsights.yaml`](/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml) file.
2121

2222
1. Replace the `<CONNECTION_STRING>` placeholder with your App Insights connection string.
2323

24-
1. Apply the configuration with:
24+
1. Deploy the OpenTelemetry Collector into the same namespace where your Dapr-enabled applications are running:
2525

26-
```sh
26+
```sh
2727
kubectl apply -f open-telemetry-collector-appinsights.yaml
2828
```
2929

30-
## Set up Dapr to send trace to OTEL Collector
30+
## Set up Dapr to send traces to the OpenTelemetry Collector
3131

32-
Set up a Dapr configuration file to turn on tracing and deploy a tracing exporter component that uses the OpenTelemetry Collector.
32+
Create a Dapr configuration file to enable tracing and send traces to the OpenTelemetry Collector via [OTLP](https://opentelemetry.io/docs/specs/otel/protocol/).
3333

34-
1. Use this [`collector-config.yaml`](/docs/open-telemetry-collector/collector-config.yaml) file to create your own configuration.
34+
1. Download and inspect the [`collector-config-otel.yaml`](/docs/open-telemetry-collector/collector-config-otel.yaml). Update the `namespace` and `otel.endpointAddress` values to align with the namespace where your Dapr-enabled applications and OpenTelemetry Collector are deployed.
3535

36-
1. Apply the configuration with:
36+
1. Apply the configuration with:
3737

3838
```sh
39-
kubectl apply -f collector-config.yaml
39+
kubectl apply -f collector-config-otel.yaml
4040
```
4141

4242
## Deploy your app with tracing
4343

44-
Apply the `appconfig` configuration by adding a `dapr.io/config` annotation to the container that you want to participate in the distributed tracing, as shown in the following example:
44+
Apply the `tracing` configuration by adding a `dapr.io/config` annotation to the Dapr applications that you want to include in distributed tracing, as shown in the following example:
4545

4646
```yaml
4747
apiVersion: apps/v1
@@ -57,18 +57,18 @@ spec:
5757
dapr.io/enabled: "true"
5858
dapr.io/app-id: "MyApp"
5959
dapr.io/app-port: "8080"
60-
dapr.io/config: "appconfig"
60+
dapr.io/config: "tracing"
6161
```
6262
6363
{{% alert title="Note" color="primary" %}}
64-
If you are using one of the Dapr tutorials, such as [distributed calculator](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator), the `appconfig` configuration is already configured, so no additional settings are needed.
64+
If you are using one of the Dapr tutorials, such as [distributed calculator](https://github.com/dapr/quickstarts/tree/master/tutorials/distributed-calculator), you will need to update the `appconfig` configuration to `tracing`.
6565
{{% /alert %}}
6666

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

6969
That's it! There's no need to include any SDKs or instrument your application code. Dapr automatically handles the distributed tracing for you.
7070

71-
## View traces
71+
## View traces
7272

7373
Deploy and run some applications. After a few minutes, you should see tracing logs appearing in your App Insights resource. You can also use the **Application Map** to examine the topology of your services, as shown below:
7474

daprdocs/static/docs/open-telemetry-collector/collector-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: dapr.io/v1alpha1
22
kind: Configuration
33
metadata:
44
name: appconfig
5-
namespace: default
5+
namespace: default # Your app namespace
66
spec:
77
tracing:
88
samplingRate: "1"

daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ metadata:
88
data:
99
otel-collector-config: |
1010
receivers:
11-
zipkin:
12-
endpoint: 0.0.0.0:9411
11+
otlp:
12+
protocols:
13+
grpc:
14+
endpoint: ${env:MY_POD_IP}:4317
1315
extensions:
1416
health_check:
17+
endpoint: :13133
1518
pprof:
1619
endpoint: :1888
1720
zpages:
@@ -31,7 +34,7 @@ data:
3134
extensions: [pprof, zpages, health_check]
3235
pipelines:
3336
traces:
34-
receivers: [zipkin]
37+
receivers: [otlp]
3538
exporters: [azuremonitor,debug]
3639
---
3740
apiVersion: v1
@@ -43,10 +46,10 @@ metadata:
4346
component: otel-collector
4447
spec:
4548
ports:
46-
- name: zipkin # Default endpoint for Zipkin receiver.
47-
port: 9411
49+
- name: otel # Default endpoint for OTEL receiver.
50+
port: 4317
4851
protocol: TCP
49-
targetPort: 9411
52+
targetPort: 4317
5053
selector:
5154
component: otel-collector
5255
---
@@ -70,7 +73,7 @@ spec:
7073
spec:
7174
containers:
7275
- name: otel-collector
73-
image: otel/opentelemetry-collector-contrib:0.101.0
76+
image: otel/opentelemetry-collector-contrib:0.127.0
7477
command:
7578
- "/otelcol-contrib"
7679
- "--config=/conf/otel-collector-config.yaml"
@@ -82,7 +85,13 @@ spec:
8285
cpu: 200m
8386
memory: 400Mi
8487
ports:
85-
- containerPort: 9411 # Default endpoint for Zipkin receiver.
88+
- containerPort: 4317 # Default endpoint for OTEL receiver.
89+
env:
90+
- name: MY_POD_IP
91+
valueFrom:
92+
fieldRef:
93+
apiVersion: v1
94+
fieldPath: status.podIP
8695
volumeMounts:
8796
- name: otel-collector-config-vol
8897
mountPath: /conf

daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-generic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
spec:
7676
containers:
7777
- name: otel-collector
78-
image: otel/opentelemetry-collector-contrib-dev:latest
78+
image: otel/opentelemetry-collector-contrib:0.127.0
7979
command:
8080
- "/otelcontribcol"
8181
- "--config=/conf/otel-collector-config.yaml"

daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-jaeger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ spec:
7878
spec:
7979
containers:
8080
- name: otel-collector
81-
image: otel/opentelemetry-collector-contrib-dev:latest
81+
image: otel/opentelemetry-collector-contrib:0.127.0
8282
command:
8383
- "/otelcontribcol"
8484
- "--config=/conf/otel-collector-config.yaml"

0 commit comments

Comments
 (0)