- Set up the PubSub quickstart for Kubernetes
- Access to a Dynatrace tenant and an API token with
openTelemetryTrace.ingest
,metrics.ingest
, andlogs.ingest
scopes
-
Create Kubernetes secret with Dynatrace credentials
kubectl create secret generic dynatrace-otelcol-dt-api-credentials \ --from-literal=DT_ENDPOINT=https://YOUR_TENANT.live.dynatrace.com/api/v2/otlp \ --from-literal=DT_API_TOKEN=dt0s01.YOUR_TOKEN_HERE
Replace
YOUR_TENANT
with your Dynatrace tenant ID andYOUR_TOKEN_HERE
with your Dynatrace API token. -
Create required namespaces
kubectl create namespace dynatrace kubectl create namespace otel-demo
-
Deploy OpenTelemetry Collector
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm repo update helm upgrade -i dynatrace-collector-gateway open-telemetry/opentelemetry-collector \ -f ./dynatrace/collector-agent.yaml \ --namespace dynatrace
-
Configure Dapr tracing
The Dapr configuration is already set up in
appconfig.yaml
to send traces to the Dynatrace OpenTelemetry Collector:apiVersion: dapr.io/v1alpha1 kind: Configuration metadata: name: appconfig spec: features: - enabled: true name: HotReload tracing: otel: endpointAddress: "dynatrace-collector-opentelemetry-collector.dynatrace.svc.cluster.local:4318" isSecure: false protocol: "http" samplingRate: "1"
Apply the configuration:
kubectl apply -f appconfig.yaml
-
Deploy PubSub components
# Deploy PubSub component kubectl apply -f pubsub.yaml # Deploy Redis state store kubectl apply -f redis.yaml
-
Deploy application components
# Deploy all subscribers kubectl apply -f csharp-subscriber.yaml kubectl apply -f node-subscriber.yaml kubectl apply -f python-subscriber.yaml # Deploy React form (publisher) kubectl apply -f react-form.yaml
Access the React form locally:
kubectl port-forward service/react-form 8000:80
Then open http://localhost:8000
in your browser to access the form.
- Navigate to your Dynatrace tenant
- Go to Distributed traces
- Look for traces from your Dapr applications
- The traces should show the full request flow from the React form through the PubSub system to all subscribers
This example covers only distributed tracing. For a complete observability setup with logs, metrics, and traces, you'll need additional configuration.
For full observability beyond just traces, refer to these resources:
- Direct log ingestion - Kubernetes pod logs via OpenTelemetry Collector
- IsItObservable Dapr example - Complete dapr example with logs/metrics/tracing setup with collectors
- Collector Prometheus configuration - Scraping Prometheus metrics via collector
- Dapr Prometheus config - Enabling Dapr metrics endpoint
- Dynatrace Collector documentation - Complete collector capabilities
- OneAgent with sidecar technologies - Guidance for other sidecar deployments
- Ensure the OpenTelemetry Collector service name matches the
endpointAddress
inappconfig.yaml
- Check collector logs:
kubectl logs -l app.kubernetes.io/name=opentelemetry-collector -n dynatrace
- Verify Dapr sidecar logs:
kubectl logs <pod-name> -c daprd