grpc-db/

directory
v0.0.0-...-74fa95f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: BSD-3-Clause

README

Datadog APM for GRPC and Databases

This example demonstrates adding Datadog tracing to GRPC clients, servers and database interactions. It contains:

  • A simple protobuf definition for a "CRUD" service
  • A GRPC client that interacts using the "CRUD" service
  • A GRPC server that stores data in postgresql using standard database/sql methods
  • A GRPC server that stores data in postgresql using gorm

Run using docker-compose

A simple way to build and run these applications is using docker-compose.

export DD_API_KEY="..." # enter your unique key here
docker-compose build
docker-compose up -d
docker-compose logs grpc-db-client

Example output

$ docker-compose logs grpc-db-client
Attaching to grpc-db_grpc-db-client_1
grpc-db-client_1     | 2019/09/09 18:04:46 created, id = 1
grpc-db-client_1     | 2019/09/09 18:04:46 queried. found = true name = foo
grpc-db-client_1     | 2019/09/09 18:04:46 updated = true
grpc-db-client_1     | 2019/09/09 18:04:46 deleted = true

Trace List

Trace Detail

Run locally

These can be built and run locally:

go get github.com/DataDog/trace-examples/go/grpc/grpc-db/...

This will create the three applications:

  • grpc-db-client
  • grpc-dbsql-server
  • grpc-gorm-server

To run these, a postgres database and datadog agent instance will be required.

Directories

Path Synopsis
cmd
proto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL