GitHunt
MA

makeavish/distributed-tracing-golang-sample

Distributed Tracing Golang Sample

This project demonstrates how to instrument distrubted tracing in golang application with the help of below microservices:

  • order-service
  • payment-service
  • user-service

For this you would need the following:

Tracing flow

distributed_tracing_app_otel_signoz

Running the code

Start the signoz server following the instructions:

git clone -b main https://github.com/SigNoz/signoz.git
cd signoz/deploy/
./install.sh

Configuration for microservices can be updated in .env file

# service config
USER_URL=localhost:8080
PAYMENT_URL=localhost:8081
ORDER_URL=localhost:8082

# database config
SQL_USER=root
SQL_PASSWORD=password
SQL_HOST=localhost:3306
SQL_DB=signoz

# telemetry config
OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317
INSECURE_MODE=true

Start individual microservices using below commands

  1. User Service
go run ./users
  1. Payment Service
go run ./payment
  1. Order Service
go run ./order

Start the frontend using following command. For installation of serve see: https://www.npmjs.com/package/serve

serve -l 5000 frontend

View traces and metrics at http://localhost:3301/

Languages

Go79.8%JavaScript15.8%HTML3.2%Shell1.2%

Contributors

Created April 12, 2023
Updated March 19, 2023
makeavish/distributed-tracing-golang-sample | GitHunt