Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morzhanov/go-otel
Go OpenTelemetry example
https://github.com/morzhanov/go-otel
Last synced: 5 days ago
JSON representation
Go OpenTelemetry example
- Host: GitHub
- URL: https://github.com/morzhanov/go-otel
- Owner: morzhanov
- Created: 2021-10-17T20:14:04.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-19T09:55:12.000Z (about 3 years ago)
- Last Synced: 2024-11-08T00:52:36.548Z (about 2 months ago)
- Language: Go
- Size: 190 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go OpenTelemetry example
Go OpenTelemetry example.
## App Description
Simple app: Orders and Payments services + API GW.
- API GW handles REST requests and proxies them to services
- Orders - create and process orders
- Payments - process payment and return payment info
- Orders handles REST requests from API GW
- Payments handles gRPC requests from API GW
- Payments handles Kafka events from API GW
- Orders saves data to MongoDB
- Payments saves data to PostgreSQL## OpenTelemetry Features
Application contains OpenTelemetry setup:- Tracer setup with Jaeger exporter
- Tracer creates spans for all transports: REST, gRPC, Events, DB requests
- Meter setup with Prometheus exporter
- Jaeger and Prometheus deployed with docker-compose## Structure
- `/api` - contains Kafka, REST and gRPC service and message definitions
- `/cmd` - application setup
- `/config` - .env file with environment variables
- `/deploy`
- `docker-compose.yml` - docker-compose file with Jaeger, Prometheus, MongoDB and PostgreSQL setup
- `/internal`
- `/apigw` - API GW service internals
- `/config` - config files setup with viper
- `/event` - events base controller
- `/grpc` - grpc base controller
- `/logger` - application logger, creates file transport (for filebeat) and console transport
- `/mongodb` - mongodb database setup
- `/order` - order service internals
- `/payment` - payment service internals
- `/psql` - postgres database setup
- `/rest` - application REST base controller
- `/telemetry` - otel setup files## Local Running
You should deploy dependencies with docker-compose:
```
cd deploy
docker-compose up -d
```Then you could run all services separately:
```
go run ./cmd//main.go
```