Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save codyborders/e84d2e66554840d995eed29abea1c7c0 to your computer and use it in GitHub Desktop.

Select an option

Save codyborders/e84d2e66554840d995eed29abea1c7c0 to your computer and use it in GitHub Desktop.

Revisions

  1. @shigeya-dd shigeya-dd revised this gist Jun 28, 2022. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions OpenTelemetry_demo_with_datadog.md
    Original file line number Diff line number Diff line change
    @@ -59,10 +59,11 @@ exporters:
    endpoint: "otelcol:9464"
    + datadog:
    + api:
    + key: <API_KEY>
    + key: <API_KEY>
    + env: otel
    + tags:
    + - otel:true
    + host_metadata:
    + tags:
    + - otel:true

    ...
    service:
  2. @shigeya-dd shigeya-dd revised this gist Jun 26, 2022. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions OpenTelemetry_demo_with_datadog.md
    Original 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
    >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
    >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)
    >OpenTelemetry collector Datadog exporter (Datadog document)
    >https://docs.datadoghq.com/tracing/setup_overview/open_standards/otel_collector_datadog_exporter
    >Datadog Exporter (Github)
    >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.
  3. @shigeya-dd shigeya-dd revised this gist Jun 26, 2022. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions OpenTelemetry_demo_with_datadog.md
    Original 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
    + api:
    + key: <API_KEY>
    + env: otel
    + tags:
    + - otel:true

    ...
    service:
  4. @shigeya-dd shigeya-dd revised this gist Jun 26, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions OpenTelemetry_demo_with_datadog.md
    Original 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_yaml:src/otelcollector/otelcol-config.yml
    ```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_yaml:. /docker-compose.yaml
    ```diff
    [./docker-compose.yaml]

    # Collector
  5. @shigeya-dd shigeya-dd revised this gist Jun 26, 2022. 1 changed file with 12 additions and 8 deletions.
    20 changes: 12 additions & 8 deletions OpenTelemetry_demo_with_datadog.md
    Original 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/
    >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
    >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
    >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
    >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
    [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.
    `[./docker-compose.yaml]`
    ```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

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/b7974ac5-3e25-16ab-ced7-e38c349d8c71.png)

    Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information !
    Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information!

    ![](https://user-images.githubusercontent.com/59518903/175795420-6aa5c033-ccb2-4d25-8fad-9e6a9352ad68.jpg)

    Metrics: Metrics are also sent and tagged !
    Metrics: Metrics are also sent and tagged!

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/f2501d02-3250-1d61-dc64-cff38b9796e7.png)

  6. @shigeya-dd shigeya-dd revised this gist Jun 26, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion OpenTelemetry_demo_with_datadog.md
    Original 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 !

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/096006ea-3997-d02f-57b5-ac1bac7ca015.png)
    ![](https://user-images.githubusercontent.com/59518903/175795420-6aa5c033-ccb2-4d25-8fad-9e6a9352ad68.jpg)

    Metrics: Metrics are also sent and tagged !

  7. @shigeya-dd shigeya-dd created this gist Jun 26, 2022.
    117 changes: 117 additions & 0 deletions OpenTelemetry_demo_with_datadog.md
    Original 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.)

    ![](https://opentelemetry.io/img/blog/current-demo-architecture.png)

    # 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.

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/ff645144-d098-1a46-50da-c483f488eb4d.png)

    Similarly, you can access Prometheus at `http://localhost:9090` and Jeager at `http://localhost:16686`.

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/56f4bf5c-0dc1-3f82-acd8-ba1b10f0a82c.png)

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/9479887e-2e53-1c37-7e0f-75c7e987b158.png)

    # 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!

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/b7974ac5-3e25-16ab-ced7-e38c349d8c71.png)

    Trace: In the individual traces, you can see the backend invocation relationships, the time taken, and other detailed information !

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/096006ea-3997-d02f-57b5-ac1bac7ca015.png)

    Metrics: Metrics are also sent and tagged !

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/f2501d02-3250-1d61-dc64-cff38b9796e7.png)

    # 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/

    ![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325973/c4a003d5-5f82-03b6-f376-e7c99926e88d.png)