From 75f3c739f381d4729cef2dec319226807444c1d1 Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Wed, 9 Dec 2020 08:43:35 -0800 Subject: [PATCH] Update OpenTelemetry Collector doc to use Zipkin API (#990) --- .../monitoring/open-telemetry-collector.md | 8 +++---- .../collector-component.yaml | 22 ------------------- .../collector-config.yaml | 10 +++++++++ .../open-telemetry-collector.yaml | 19 ++++++++-------- 4 files changed, 24 insertions(+), 35 deletions(-) delete mode 100644 daprdocs/static/docs/open-telemetry-collector/collector-component.yaml create mode 100644 daprdocs/static/docs/open-telemetry-collector/collector-config.yaml diff --git a/daprdocs/content/en/operations/monitoring/open-telemetry-collector.md b/daprdocs/content/en/operations/monitoring/open-telemetry-collector.md index 9645bd474..eb8136a80 100644 --- a/daprdocs/content/en/operations/monitoring/open-telemetry-collector.md +++ b/daprdocs/content/en/operations/monitoring/open-telemetry-collector.md @@ -6,7 +6,7 @@ weight: 1000 description: "How to use Dapr to push trace events to Azure Application Insights, through the OpenTelemetry Collector." --- -Dapr can integrate with [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) using the OpenCensus API. This guide walks through an example to use Dapr to push trace events to Azure Application Insights, through the OpenTelemetry Collector. +Dapr can integrate with [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) using the Zipkin API. This guide walks through an example to use Dapr to push trace events to Azure Application Insights, through the OpenTelemetry Collector. ## Requirements @@ -29,15 +29,15 @@ export APP_INSIGHTS_KEY= Next, install the OpenTelemetry Collector to your Kubernetes cluster to push events to your Application Insights instance -1. Check out the file [open-telemetry-collector.yaml](/docs/open-telemetry-collector/open-telemetry-collector.yaml) and replace the `` placeholder with your `APP_INSIGHTS_KEY`. +1. Check out the file [open-telemetry-collector.yaml](/docs/open-telemetry-collector/open-telemetry-collector.yaml) and replace the `` placeholder with your `APP_INSIGHTS_KEY`. 2. Apply the configuration with `kubectl apply -f open-telemetry-collector.yaml`. Next, set up both a Dapr configuration file to turn on tracing and deploy a tracing exporter component that uses the OpenTelemetry Collector. -1. Create a collector-component.yaml file with this [content](/docs/open-telemetry-collector/collector-component.yaml) +1. Create a collector-config.yaml file with this [content](/docs/open-telemetry-collector/collector-config.yaml) -2. Apply the configuration with `kubectl apply -f collector-component.yaml`. +2. Apply the configuration with `kubectl apply -f collector-config.yaml`. ### Deploy your app with tracing diff --git a/daprdocs/static/docs/open-telemetry-collector/collector-component.yaml b/daprdocs/static/docs/open-telemetry-collector/collector-component.yaml deleted file mode 100644 index e157a4c9d..000000000 --- a/daprdocs/static/docs/open-telemetry-collector/collector-component.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: dapr.io/v1alpha1 -kind: Configuration -metadata: - name: appconfig - namespace: default -spec: - tracing: - samplingRate: "1" ---- -apiVersion: dapr.io/v1alpha1 -kind: Component -metadata: - name: native - namespace: default -spec: - type: exporters.native - version: v1 - metadata: - - name: enabled - value: "true" - - name: agentEndpoint - value: "otel-collector.default.svc.cluster.local:55678" diff --git a/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml b/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml new file mode 100644 index 000000000..78b37a928 --- /dev/null +++ b/daprdocs/static/docs/open-telemetry-collector/collector-config.yaml @@ -0,0 +1,10 @@ +apiVersion: dapr.io/v1alpha1 +kind: Configuration +metadata: + name: appconfig + namespace: default +spec: + tracing: + samplingRate: "1" + zipkin: + endpointAddress: "http://otel-collector.default.svc.cluster.local:9411/api/v2/spans" diff --git a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector.yaml b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector.yaml index 3516ab364..bae9a336e 100644 --- a/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector.yaml +++ b/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector.yaml @@ -8,8 +8,8 @@ metadata: data: otel-collector-config: | receivers: - opencensus: - endpoint: 0.0.0.0:55678 + zipkin: + endpoint: 0.0.0.0:9411 processors: queued_retry: batch: @@ -20,8 +20,9 @@ data: zpages: endpoint: :55679 exporters: + logging: + loglevel: debug azuremonitor: - azuremonitor/2: endpoint: "https://dc.services.visualstudio.com/v2/track" instrumentation_key: "" # maxbatchsize is the maximum number of items that can be @@ -34,8 +35,8 @@ data: extensions: [pprof, zpages, health_check] pipelines: traces: - receivers: [opencensus] - exporters: [azuremonitor/2] + receivers: [zipkin] + exporters: [azuremonitor,logging] processors: [batch, queued_retry] --- apiVersion: v1 @@ -47,10 +48,10 @@ metadata: component: otel-collector spec: ports: - - name: opencensus # Default endpoint for Opencensus receiver. - port: 55678 + - name: zipkin # Default endpoint for Zipkin receiver. + port: 9411 protocol: TCP - targetPort: 55678 + targetPort: 9411 selector: component: otel-collector --- @@ -86,7 +87,7 @@ spec: cpu: 200m memory: 400Mi ports: - - containerPort: 55678 # Default endpoint for Opencensus receiver. + - containerPort: 9411 # Default endpoint for Zipkin receiver. volumeMounts: - name: otel-collector-config-vol mountPath: /conf