- A Golang Project using Gin, OpenTelemetry, and Datadog.
- I saw some examples, but they were missing parts, so I decided to create one that could give me an overview.
-
OpenTelemetry Collector
-
Datadog Agent
-
Golang code Instrumented.
-
I decided to keep only the minimum necessary so you don't have to worry about the load of knowledge at once.
The OpenTelemetry Collector offers a vendor-agnostic implementation of how to receive, process and export telemetry data. It removes the need to run, operate, and maintain multiple agents/collectors.
- Datadog offers the dd_trace library, which can help you get your traces done and communicate directly with the Datadog Agent, but this is vendor lock-in.
- If that is not a problem, go forward and implement using dd_trace.
- Requirements
- Datadog API Key
- Docker
- Inside the
docker-compose.yaml
replace the value of:- DD_API_KEY
- DD_SITE
- You must have these values since you already have a Datadog account.
⚠️ Please note that you must update the environmentOTEL_EXPORTER_OTLP_ENDPOINT
too, because it uses the DD_SITE.
- Execute
docker compose up -d
- Access the project at http://localhost:8080
- Make some GET requests to the endpoint: http://localhost:8080/api/v1/users
- Go to Datadog and you should see a project named
gin-example
.