Skip to content

SigNoz/distributed-tracing-golang-sample

 
 

Repository files navigation

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

Using docker-compose

docker-compose up -d

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

Note: Replace OTEL_EXPORTER_OTLP_ENDPOINT environment variable with SigNoz OTLP endpoint, if SigNoz not running on host machine.

Using Source

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/src

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 72.5%
  • JavaScript 15.8%
  • Dockerfile 4.4%
  • Makefile 4.0%
  • HTML 3.1%
  • Shell 0.2%