diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 21ce62d3a..b4a35ab56 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -108,9 +108,9 @@ sidebar_search_disable = true icon = "fab fa-github" desc = "Development takes place here!" [[params.links.developer]] - name = "Gitter" - url = "https://gitter.im/Dapr/community" - icon = "fab fa-gitter" + name = "Discord" + url = "https://aka.ms/dapr-discord" + icon = "fab fa-discord" desc = "Conversations happen here!" [[params.links.developer]] name = "Zoom" diff --git a/daprdocs/content/en/operations/monitoring/jaeger.md b/daprdocs/content/en/operations/monitoring/jaeger.md new file mode 100644 index 000000000..bafd88dea --- /dev/null +++ b/daprdocs/content/en/operations/monitoring/jaeger.md @@ -0,0 +1,159 @@ +--- +type: docs +title: "How-To: Set up Jaeger for distributed tracing" +linkTitle: "Jaeger" +weight: 3000 +description: "Set up Jaeger for distributed tracing" +type: docs +--- +Dapr currently supports two kind of tracing protocol: OpenCensus and +Zipkin. Since Jaeger is compatible with Zipkin, the Zipkin +protocol can be used to talk to Jaeger. + +## Configure self hosted mode + +### Setup + +The simplest way to start Jaeger is to use the pre-built all-in-one +Jaeger image published to DockerHub: + +```bash +docker run -d --name jaeger \ + -e COLLECTOR_ZIPKIN_HTTP_PORT=9412 \ + -p 16686:16686 \ + -p 9412:9412 \ + jaegertracing/all-in-one:1.21 +``` + + +Next, create the following YAML files locally: + +* **jaeger.yaml**: Note that because we are using the Zipkin protocol to talk to Jaeger, +the type of the exporter in the YAML file below is `exporter.zipkin`, +while the `exporterAddress` is the address of the Jaeger instance. + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: zipkin +spec: + type: exporters.zipkin + metadata: + - name: enabled + value: "true" + - name: exporterAddress + value: "http://localhost:9412/api/v2/spans" +``` + +To launch the application referring to the new YAML file, you can use +`--components-path`. Assuming that, the **jaeger.yaml** file is in the +current directory, you can use + +```bash +dapr run --app-id mynode --app-port 3000 node app.js --components-path . +``` + +### Viewing Traces +To view traces, in your browser go to http://localhost:16686 and you +will see the Zipkin UI. + +## Configure Kubernetes +The following steps shows you how to configure Dapr to send distributed tracing data to Jaeger running as a container in your Kubernetes cluster, how to view them. + +### Setup + +First create the following YAML file to install Jaeger +* jaeger-operator.yaml +```yaml +apiVersion: jaegertracing.io/v1 +kind: "Jaeger" +metadata: + name: "jaeger" +spec: + strategy: allInOne + ingress: + enabled: false + allInOne: + image: jaegertracing/all-in-one:1.13 + options: + query: + base-path: /jaeger +``` + +Now, use the above YAML file to install Jaeger +```bash +# Install Jaeger +helm repo add jaegertracing https://jaegertracing.github.io/helm-charts +helm install jaeger-operator jaegertracing/jaeger-operator +kubectl apply -f jaeger-operator.yaml + +# Wait for Jaeger to be up and running +kubectl wait deploy --selector app.kubernetes.io/name=jaeger --for=condition=available +``` + +Next, create the following YAML files locally: + +* **jaeger.yaml**: Note that because we are using the Zipkin protocol to talk to Jaeger, +the type of the exporter in the YAML file below is `exporter.zipkin`, +while the `exporterAddress` is the address of the Jaeger instance. + + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Component +metadata: + name: zipkin +spec: + type: exporters.zipkin + metadata: + - name: enabled + value: "true" + - name: exporterAddress + value: "http://jaeger-collector.default.svc.cluster.local:9411/api/v2/spans" +``` + +* **tracing.yaml** + +```yaml +apiVersion: dapr.io/v1alpha1 +kind: Configuration +metadata: + name: tracing + namespace: default +spec: + tracing: + samplingRate: "1" +``` + +Finally, deploy the the Dapr component and configuration files: + +```bash +kubectl apply -f tracing.yaml +kubectl apply -f jaeger.yaml +``` + +In order to enable this configuration for your Dapr sidecar, add the following annotation to your pod spec template: + +```yml +annotations: + dapr.io/config: "tracing" +``` + +That's it! your sidecar is now configured for use with Jaeger. + +### Viewing Tracing Data + +To view traces, connect to the Jaeger Service and open the UI: + +```bash +kubectl port-forward svc/jaeger-query 16686 +``` + +In your browser, go to `http://localhost:16686` and you will see the Jaeger UI. + +![jaeger](/images/jaeger_ui.png) + +## References +- [Jaeger Getting Started](https://www.jaegertracing.io/docs/1.21/getting-started/#all-in-one) +- [W3C distributed tracing]({{< ref w3c-tracing >}}) diff --git a/daprdocs/content/en/reference/api/error_codes.md b/daprdocs/content/en/reference/api/error_codes.md index 94d7338d9..d5053b763 100644 --- a/daprdocs/content/en/reference/api/error_codes.md +++ b/daprdocs/content/en/reference/api/error_codes.md @@ -31,6 +31,7 @@ Following table lists the error codes returned by Dapr runtime: | ERR_ACTOR_STATE_TRANSACTION_SAVE | Error storing actor state transactionally. | ERR_PUBSUB_NOT_FOUND | Error referencing the Pub/Sub component in Dapr runtime. | ERR_PUBSUB_PUBLISH_MESSAGE | Error publishing a message. +| ERR_PUBSUB_FORBIDDEN | Error message forbidden by access controls. | ERR_PUBSUB_CLOUD_EVENTS_SER | Error serializing Pub/Sub event envelope. | ERR_STATE_STORE_NOT_FOUND | Error referencing a state store not found. | ERR_STATE_STORES_NOT_CONFIGURED | Error no state stores configured. diff --git a/daprdocs/content/en/reference/api/pubsub_api.md b/daprdocs/content/en/reference/api/pubsub_api.md index 67a221fbb..eedff06ad 100644 --- a/daprdocs/content/en/reference/api/pubsub_api.md +++ b/daprdocs/content/en/reference/api/pubsub_api.md @@ -22,6 +22,7 @@ POST http://localhost:/v1.0/publish// Code | Description ---- | ----------- 204 | Message delivered +403 | Message forbidden by access controls 404 | No pubsub name or topic given 500 | Delivery failed diff --git a/daprdocs/content/en/reference/api/service_invocation_api.md b/daprdocs/content/en/reference/api/service_invocation_api.md index 2064b82f2..6f35649ed 100644 --- a/daprdocs/content/en/reference/api/service_invocation_api.md +++ b/daprdocs/content/en/reference/api/service_invocation_api.md @@ -30,6 +30,7 @@ Code | Description ---- | ----------- XXX | Upstream status returned 400 | Method name not given +403 | Invocation forbidden by access control 500 | Request failed ### URL Parameters diff --git a/daprdocs/static/images/jaeger_ui.png b/daprdocs/static/images/jaeger_ui.png new file mode 100644 index 000000000..6e95b2fe6 Binary files /dev/null and b/daprdocs/static/images/jaeger_ui.png differ