Skip to content

Gullity/gin_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gin Example

  • A Golang Project using Gin, OpenTelemetry, and Datadog.

Idea

  • I saw some examples, but they were missing parts, so I decided to create one that could give me an overview.

⚠️ The only update that this code might have is related to logs. I'm still trying to see other ways.

What we have here

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

How it works

image

Why I need the Collector

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.

Collector

Untitled-2024-06-23-1859

How to Run

  • Requirements
    • Datadog API Key
    • Docker

First

  • 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 environment OTEL_EXPORTER_OTLP_ENDPOINT too, because it uses the DD_SITE.

Second

  • Execute
docker compose up -d

Third

Fourth

  • Go to Datadog and you should see a project named gin-example.

⚠️ Datadog can take 5 min to update the interface.

Datadog Configuration

OpenTelemetry Config

About

A Golang Project using Gin, OpenTelemetry and Datadog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published