Source Context

Learn how to show source lines in Go stack traces.

Source context shows the lines around a frame in a stack trace so you can see the code that failed without leaving Sentry.

For Go, source context is provided through SCM Source Context with code mappings.

To use source context with Go:

  1. Set up a supported SCM integration.
  2. Configure code mappings for your project.
  3. Enable source context for the project.

For setup details, see SCM Source Context.

If stack traces are missing source lines, make sure that:

  • Your project has a supported SCM integration installed
  • Your project has code mappings configured correctly
  • Source context is enabled for the project
  • The event is associated with a release or branch that Sentry can resolve through your code mappings
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").