Still using Jaeger/Sentry? Uptrace is a distributed tracing tool that monitors performance, errors, and logs using OpenTelemetry.

Gin OpenTelemetry Instrumentation


To install Gin OpenTelemetry instrumentation:

go get


You can instrument Gin router by installing OpenTelemetry middleware:

import (

router := gin.Default()

Instrumenting templates rendering

To instrument templates rendering, use otelgin.HTML helper:

import ""

func exampleHandler(c *gin.Context) {
	otelgin.HTML(c, http.StatusOK, indexTmpl, gin.H{
		"foo": "bar",

What's next?

Next, instrument more operations, for example, database queries, errors, and logs. You can also learn about OpenTelemetry Go Tracing API to create your own instrumentations.

Popular instrumentations:

See also:

Last Updated: