Jaeger (Tracing)

Introduction

Jaeger, inspired by Dapper and OpenZipkin, is a distributed tracing system released as open source by Uber Technologies.
It is used for monitoring and troubleshooting microservices-based distributed systems, including:

Creating the exporter

To create the exporter, we’ll need to:

Create an exporter in code

Have the Jaeger endpoint available to receive traces

packagemainimport("log""go.opencensus.io/exporter/jaeger""go.opencensus.io/trace")funcmain(){// Port details: https://www.jaegertracing.io/docs/getting-started/
agentEndpointURI:="localhost:6831"collectorEndpointURI:="http://localhost:14268"je,err:=jaeger.NewExporter(jaeger.Options{AgentEndpoint:agentEndpointURI,Endpoint:collectorEndpointURI,ServiceName:"demo",})iferr!=nil{log.Fatalf("Failed to create the Jaeger exporter: %v",err)}// And now finally register it as a Trace Exporter
trace.RegisterExporter(je)}