Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.1 KB

README.md

File metadata and controls

62 lines (46 loc) · 1.1 KB

OpenTelemetry Example

Objective

Write an example on how to use OpenTelemetry with:

  1. HTTP Client
  2. gRPC Server
  3. Postgres Client
  4. Redis Client

This example consists of a Cat API, where cats are registered along with cat facts.

Running

Start Jaeger, Postgres and Redis:

make deps
make migrations

Run the application:

make run

Call the API:

Create a cat:

grpcurl \
  -d '{ "cat": { "name": "Tom", "id": "tom" } }' \
  -plaintext localhost:8080 \
  api.v1.CatService/CreateCat

Create another cat (if within 10s, the same cat fact will be used from cache):

grpcurl \
  -d '{ "cat": { "name": "Garfield", "id": "garfield" } }' \
  -plaintext localhost:8080 \
  api.v1.CatService/CreateCat

List cats:

grpcurl \
  -plaintext localhost:8080 \
  api.v1.CatService/ListCats

Find the traces in Jaeger UI:

  • List cats List cats

  • Create cat Create cat

  • Create already existing cat Create already existing cat