ObserveNow
...
Integrations
Applications

Go

go tracing instrumentation opentelemetry is the recommended approach to instrument for tracing for your go applications, please follow the instructions in the following document to instrument opentelemetry go libraries https //opentelemetry io/docs/instrumentation/go/libraries/ summary of steps determine what framework (standard or 3rd party) your go apps are using (e g , net/http , gorilla/mux , etc) navigate to opentelemetry registry https //opentelemetry io/registry/?language=go\&component=instrumentation to find if the packages from (1) have an already existing instrumentation library import the instrumented libraries into your app and initialize them (the trace initialization can be a one time addition to your own shared library or, alternatively, some inittracer() func in each app) wrap the handler functions to achieve the "auto" instrumentation example the example in the above links shows the above steps for the net/http package here is another example this sample go app is using the gofiber/fiber package we've found that instrumentation libraries exist on the opentelemetry registry and clicked to verify the library names import the instrumented libraries import ( "context" "github com/gofiber/contrib/otelfiber" "go opentelemetry io/otel" "go opentelemetry io/otel/sdk/resource" // if wanting to use standard output exporter for testing // "go opentelemetry io/otel/exporters/stdout/stdouttrace" "go opentelemetry io/otel/exporters/zipkin" "go opentelemetry io/otel/propagation" sdktrace "go opentelemetry io/otel/sdk/trace" semconv "go opentelemetry io/otel/semconv/v1 4 0" ) trace initialization func inittracer() sdktrace tracerprovider { exporter, err = zipkin new("http //otel collector devopsnow\ svc cluster local 9411") // use the standard out exporter instead if local testing // exporter, err = stdouttrace new(stdouttrace withprettyprint()) if err != nil { fmt println(err) } tp = sdktrace newtracerprovider( sdktrace withsampler(sdktrace alwayssample()), sdktrace withbatcher(exporter), sdktrace withresource( resource newwithattributes( semconv schemaurl, semconv servicenamekey string("my cool app"), )), ) otel settracerprovider(tp) otel settextmappropagator(propagation newcompositetextmappropagator(propagation tracecontext{}, propagation baggage{})) return tp } (4) tell the app to use the middleware to auto wrap your handlers func main() { 	tp = inittracer() 	defer func() { 	 if err = tp shutdown(context background()); err != nil { 	 fmt printf("error shutting down tracer provider %v", err) 	 } 	}() app = fiber new() 	app use(otelfiber middleware("my cool app")) routes setup(app) port = "8000" for production use, you'll be using the zipkin exporter (as seen in the code) this will make the go application to emit spans which will be collected by the opentelemetry collector installed as part of the opsverse agent and forwarded to the tracing backend