Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andream16/go-opentracing-example
opentracing-go example that generates a trace and child spans across http, grpc, kafka and postgresql.
https://github.com/andream16/go-opentracing-example
go grpc http jaeger jaegertracing kafka opentracing span traces tracing
Last synced: 4 months ago
JSON representation
opentracing-go example that generates a trace and child spans across http, grpc, kafka and postgresql.
- Host: GitHub
- URL: https://github.com/andream16/go-opentracing-example
- Owner: andream16
- License: mit
- Created: 2021-02-08T21:01:27.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-22T22:10:00.000Z (almost 4 years ago)
- Last Synced: 2024-09-30T16:21:41.131Z (4 months ago)
- Topics: go, grpc, http, jaeger, jaegertracing, kafka, opentracing, span, traces, tracing
- Language: Go
- Homepage:
- Size: 248 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-opentracing-example
End-to-end go [opentracing](https://opentracing.io/) example using [jaeger](https://github.com/jaegertracing/jaeger) as tracer.
This example shows how to leverage open tracing to see a span that covers the following flow:
![1](./docs/architecture.png)
As you can see:
- a span is started by performing an HTTP request to the `http-sever-initiator` that calls `http-sever-receiver` over HTTP in turn
- `http-sever-receiver` calls `grpc-server` over GRPC after having registered a child span
- `grpc-server` publishes a message into kafka and returns a successful response upstream after having registered a child span
- `kafka-consumer` consumes the message from the `todos` topic and creates a new record in the `todos` table.
It creates two spans: one for the time spent in the whole consumer logic and one for the time spent during the database query.
## How to run
You can run the project using `docker-compose up` (tbd)## TODOS
- Write solid documentation.