Automatic Instrumentation

Learn what gets captured automatically when using Sentry's HTTP framework middleware.

If you're using one of Sentry's HTTP framework middlewares, transactions are created automatically for all incoming HTTP requests when tracing is enabled. No additional code is needed beyond the middleware setup.

The Sentry middleware for this framework automatically creates transactions for all incoming HTTP requests when tracing is enabled. Each transaction includes:

  • Transaction name: HTTP method and route path (e.g., GET /users/:id)
  • HTTP status code: Captured when the response is sent
  • Distributed tracing: Continues traces from upstream services via Sentry trace headers
  • Request context: Hub attached for additional error capture and custom spans

You can add custom child spans within your handlers to track specific operations.

Sentry provides middleware for the following Go HTTP frameworks:

FrameworkPackageGuide
Ginsentry-go/ginGin guide
Echosentry-go/echoEcho guide
Fibersentry-go/fiberFiber guide
net/httpsentry-go/httpnet/http guide
Irissentry-go/irisIris guide
FastHTTPsentry-go/fasthttpFastHTTP guide
Negronisentry-go/negroniNegroni guide

Each middleware is installed and configured as part of the framework setup. See the individual guide pages for installation instructions.

For outbound HTTP requests, use the sentryhttpclient package to automatically create spans for client requests. See the HTTP Requests documentation for details.

Once the middleware creates a transaction, you can add child spans within your handlers to track specific operations. See Custom Instrumentation for details.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").