Technology
Dapr
Monitor and observe your Dapr applications with distributed tracing, metrics, and logs using OpenTelemetry integration.
Overview
Overview
Dapr (Distributed Application Runtime) is a portable, event-driven runtime that makes it easy for developers to build resilient microservice applications. With Dash0, you can gain comprehensive observability into your Dapr applications through distributed tracing, metrics, and logs.
Use Cases
- Monitor Dapr runtime performance and health
- Track distributed traces across microservices
- Observe service-to-service communication patterns
- Monitor pub/sub message flows and state management operations
- Analyze HTTP and gRPC API performance
- Track actor invocations and state changes
- Monitor bindings and secrets usage
Prerequisites
- Dapr runtime installed on Kubernetes
- OpenTelemetry Collector configured in your cluster
Setup
Setup
Dapr captures metrics, traces, and logs that can be sent directly to Dash0 through the OpenTelemetry Collector. This guide shows you how to configure Dapr tracing with the OpenTelemetry Collector and Dash0.
By using the OpenTelemetry Collector with the OTLP exporter to send data to Dash0, you can configure Dapr to create traces for each application in your Kubernetes cluster and collect them in Dash0 for analysis and monitoring.
Configure the OpenTelemetry Collector
This example shows a simple OpenTelemetry Collector configuration that will receive telemetry from Dapr and forward it to Dash0.
For production environments, consider using one of these more robust deployment methods:
- Dash0 operator for Kubernetes (recommended)
- OpenTelemetry Operator for Kubernetes
-
Helm Chart for The OpenTelemetry Collector
The key requirement is that your collector accepts OTLP/gRPC on port 4317.
Step 1: Create a namespace for the Collector
kubectl create namespace opentelemetryStep 2: Create a Secret with your Dash0 Auth Token and Endpoint
kubectl create secret generic dash0-secrets \
--from-literal=dash0-authorization-token="<your_auth_token>" \
--from-literal=dash0-endpoint="<your_otlp_grpc_endpoint>" \
--namespace opentelemetryStep 3: Add the OpenTelemetry Helm repo
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo updateStep 4: Create values.yaml for the Collector
This configuration:
- Reads token + endpoint from the Secret via env vars
- Enables OTLP receivers (gRPC + HTTP)
- Sends traces, metrics, and logs to Dash0 via OTLP/gRPC with Bearer auth
mode: deployment
fullnameOverride: otel-collector
replicaCount: 1
image:
repository: otel/opentelemetry-collector-k8s
extraEnvs:
- name: DASH0_AUTHORIZATION_TOKEN
valueFrom:
secretKeyRef:
name: dash0-secrets
key: dash0-authorization-token
- name: DASH0_ENDPOINT
valueFrom:
secretKeyRef:
name: dash0-secrets
key: dash0-endpoint
config:
receivers:
otlp:
protocols:
grpc: {}
http: {}
processors:
batch: {}
exporters:
otlp/dash0:
auth:
authenticator: bearertokenauth/dash0
endpoint: ${env:DASH0_ENDPOINT}
extensions:
bearertokenauth/dash0:
scheme: Bearer
token: ${env:DASH0_AUTHORIZATION_TOKEN}
health_check: {}
service:
extensions:
- bearertokenauth/dash0
- health_check
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp/dash0]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlp/dash0]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp/dash0]Step 5: Install/upgrade the Collector with Helm
helm upgrade --install otel-collector open-telemetry/opentelemetry-collector \
--namespace opentelemetry \
-f values.yamlConfigure Dapr to send telemetry to the Collector
Step 1: Create a configuration
Create dapr-config.yaml:
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: tracing
namespace: default
spec:
tracing:
samplingRate: "1"
otel:
endpointAddress: "otel-collector.opentelemetry.svc.cluster.local:4317"
isSecure: false
protocol: grpcNote: If you used a different collector deployment method, update the endpointAddress to match your collector's service name and namespace.
Apply it:
kubectl apply -f dapr-config.yamlStep 2: Annotate your application(s)
In each Deployment/Pod you want traced by Dapr, add:
metadata:
annotations:
dapr.io/config: "tracing"Verify the setup
- Check that the OpenTelemetry Collector is running:
kubectl get pods -n opentelemetry- Check the collector logs to ensure it's receiving and forwarding telemetry:
kubectl logs -n opentelemetry deployment/otel-collector- Deploy a sample application with Dapr tracing enabled and generate some traffic to verify traces are being sent to Dash0. You can use the Dapr Kubernetes quickstart tutorial for testing.
Viewing traces
Once your setup is complete and telemetry data is flowing, you can view traces in Dash0:
- Navigate to your Dash0 account
- Go to the Traces section
- You should see distributed traces from your Dapr applications
- Use filters to narrow down traces by service name, operation, or time range
Cleanup
helm -n opentelemetry uninstall otel-collector
kubectl -n opentelemetry delete secret dash0-secrets
kubectl delete ns opentelemetry