Forked from shigeya-dd/OpenTelemetry_demo_with_datadog.md
Created
July 1, 2022 19:27
-
-
Save codyborders/e84d2e66554840d995eed29abea1c7c0 to your computer and use it in GitHub Desktop.
Revisions
-
shigeya-dd revised this gist
Jun 28, 2022 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -59,10 +59,11 @@ exporters: endpoint: "otelcol:9464" + datadog: + api: + key: <API_KEY> + env: otel + host_metadata: + tags: + - otel:true ... service: -
shigeya-dd revised this gist
Jun 26, 2022 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ I just found the following article in the OpenTelemetry blog >Announcing a Community Demo for OpenTelemetry >https://opentelemetry.io/blog/2022/demo-announcement/ This is a demo kit for OpenTelemetry, where an e-commerce site is built with microservices in various languages. In addition, metrics and traces are already instrumented, and if you have a Docker environment at hand, you can just `docker compose up` to get it running. @@ -16,7 +16,7 @@ It consists of several microservices, each in a different language. (Image taken # How to run the demo Clone the Github repository and `docker compose up` to get it running. It will take a while to build the first time. >Webstore Demo >https://github.com/open-telemetry/opentelemetry-demo-webstore Once up and running, access `http://localhost:8080` in your browser and you will see the following EC site. @@ -33,10 +33,10 @@ Similarly, you can access Prometheus at `http://localhost:9090` and Jeager at `h Now let's send these metrics and traces to Datadog, which is a beta version of the Datadog Exporter for OpenTelemetry collectors, so this is just a trial use. >OpenTelemetry collector Datadog exporter (Datadog document) >https://docs.datadoghq.com/tracing/setup_overview/open_standards/otel_collector_datadog_exporter >Datadog Exporter (Github) >https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter The changes are as follows: Add the Datadog configuration to the Collector configuration file. -
shigeya-dd revised this gist
Jun 26, 2022 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,11 +58,11 @@ exporters: prometheus: endpoint: "otelcol:9464" + datadog: + api: + key: <API_KEY> + env: otel + tags: + - otel:true ... service: -
shigeya-dd revised this gist
Jun 26, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Add Datadog settings to `exporters`. Replace `<API_KEY>` with your API Key respe The following configuration will continue to be sent to Prometheus and Jeager. ```diff [src/otelcollector/otelcol-config.yml] ... @@ -77,12 +77,12 @@ service: processors: [batch] + exporters: [prometheus, [batch]] - exporters: [prometheus, logging] + exporters: [prometheus, logging, datadog] ``` Also, the Datadog Exporter is not included in the container image in the original `docker-compose.yaml`, so change the image to include the contrib. ```diff [./docker-compose.yaml] # Collector -
shigeya-dd revised this gist
Jun 26, 2022 . 1 changed file with 12 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ I just found the following article in the OpenTelemetry blog >Announcing a Community Demo for OpenTelemetry >https://opentelemetry.io/blog/2022/demo-announcement/ This is a demo kit for OpenTelemetry, where an e-commerce site is built with microservices in various languages. In addition, metrics and traces are already instrumented, and if you have a Docker environment at hand, you can just `docker compose up` to get it running. As a demonstration of OpenTelemetry, you can see traces and metrics in Jeager and Prometheus. In this article, I would like to send them to Datadog so that I can see them in Datadog. @@ -17,7 +17,7 @@ It consists of several microservices, each in a different language. (Image taken Clone the Github repository and `docker compose up` to get it running. It will take a while to build the first time. >Webstore Demo >https://github.com/open-telemetry/opentelemetry-demo-webstore Once up and running, access `http://localhost:8080` in your browser and you will see the following EC site. @@ -34,18 +34,20 @@ Similarly, you can access Prometheus at `http://localhost:9090` and Jeager at `h Now let's send these metrics and traces to Datadog, which is a beta version of the Datadog Exporter for OpenTelemetry collectors, so this is just a trial use. >OpenTelemetry collector Datadog exporter (Datadog document) >https://docs.datadoghq.com/tracing/setup_overview/open_standards/otel_collector_datadog_exporter >Datadog Exporter (Github) >https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter The changes are as follows: Add the Datadog configuration to the Collector configuration file. Add Datadog settings to `exporters`. Replace `<API_KEY>` with your API Key respectively. You can also set the `env` tag and other tags here. Now it is time to add `datadog` to `trace` and `metrics` in `pipelines` to be sent. The following configuration will continue to be sent to Prometheus and Jeager. ```diff_yaml:src/otelcollector/otelcol-config.yml [src/otelcollector/otelcol-config.yml] ... exporters: jaeger: @@ -79,8 +81,10 @@ service: Also, the Datadog Exporter is not included in the container image in the original `docker-compose.yaml`, so change the image to include the contrib. ```diff_yaml:. /docker-compose.yaml [./docker-compose.yaml] # Collector otelcol: - image: otel/opentelemetry-collector:0.52.0 @@ -97,11 +101,11 @@ Service map: I can see the call relationships between microservices and the traf  Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information!  Metrics: Metrics are also sent and tagged!  -
shigeya-dd revised this gist
Jun 26, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -99,7 +99,7 @@ Service map: I can see the call relationships between microservices and the traf Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information !  Metrics: Metrics are also sent and tagged ! -
shigeya-dd created this gist
Jun 26, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,117 @@ # Introduction I just found the following article in the OpenTelemetry blog >Announcing a Community Demo for OpenTelemetry https://opentelemetry.io/blog/2022/demo-announcement/ This is a demo kit for OpenTelemetry, where an e-commerce site is built with microservices in various languages. In addition, metrics and traces are already instrumented, and if you have a Docker environment at hand, you can just `docker compose up` to get it running. As a demonstration of OpenTelemetry, you can see traces and metrics in Jeager and Prometheus. In this article, I would like to send them to Datadog so that I can see them in Datadog. # Configuration It consists of several microservices, each in a different language. (Image taken from blog post.)  # How to run the demo Clone the Github repository and `docker compose up` to get it running. It will take a while to build the first time. >Webstore Demo https://github.com/open-telemetry/opentelemetry-demo-webstore Once up and running, access `http://localhost:8080` in your browser and you will see the following EC site.  Similarly, you can access Prometheus at `http://localhost:9090` and Jeager at `http://localhost:16686`.   # Datadog Exporter Now let's send these metrics and traces to Datadog, which is a beta version of the Datadog Exporter for OpenTelemetry collectors, so this is just a trial use. >OpenTelemetry collector Datadog exporter (Datadog document) https://docs.datadoghq.com/tracing/setup_overview/open_standards/otel_collector_datadog_exporter >Datadog Exporter (Github) https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter The changes are as follows: Add the Datadog configuration to the Collector configuration file. Add Datadog settings to `exporters`. Replace `<API_KEY>` with your API Key respectively. You can also set the `env` tag and other tags here. Now it is time to add `datadog` to `trace` and `metrics` in `pipelines` to be sent. The following configuration will continue to be sent to Prometheus and Jeager. `[src/otelcollector/otelcol-config.yml]` ```diff_yaml:src/otelcollector/otelcol-config.yml ... exporters: jaeger: endpoint: "jaeger:14250" tls: insecure: true logging: prometheus: endpoint: "otelcol:9464" + datadog: + api: + key: <API_KEY> + env: otel + tags: + - otel:true ... service: pipelines: traces: receivers: [otlp]. processors: [batch]. - exporters: [logging, jaeger] + exporters: [logging, jaeger, datadog] metrics: receivers: [otlp] processors: [batch processors: [batch] + exporters: [prometheus, [batch]] - exporters: [prometheus, logging] + exporters: [prometheus, logging, datadog] ```` Also, the Datadog Exporter is not included in the container image in the original `docker-compose.yaml`, so change the image to include the contrib. `[./docker-compose.yaml]` ```diff_yaml:. /docker-compose.yaml # Collector otelcol: - image: otel/opentelemetry-collector:0.52.0 + image: otel/opentelemetry-collector-contrib:0.52.0 command: [ "--config=/etc/otelcol-config.yml" ] ``` # It shows up in Datadog! I `docker compose up` again, accessed the EC site, and the traces and metrics showed up in Datadog as well! I was really impressed with how simple and easy it was. Service map: I can see the call relationships between microservices and the traffic flow!  Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information !  Metrics: Metrics are also sent and tagged !  # You can also receive them in Datadog Agent In this demonstration environment, metrics and traces are received by OpenTelemetry Collector and sent to Datadog, but Datadog Agent can be used instead. If you are already running Datadog Agent, you can use it as is. (However, the Agent must be the latest version.) As shown in the figure below, there are several ways to combine Datadog Agent with OpenTelemetry. Please refer to Datadog's blog post for details. >Ingest OpenTelemetry traces and metrics with the Datadog Agent https://www.datadoghq.com/blog/ingest-opentelemetry-traces-metrics-with-datadog-agent/ 