Set Up Profiling

Learn how to enable profiling in your app if it is not already set up.

Go Profiling is currently in alpha and is available since SDK version 0.22.0. Alpha features are still in progress and may have bugs. We recognize the irony.

With profiling, Sentry tracks your software's performance by sampling your program's call stack in a variety of environments. This feature collects function-level information about your code and enables you to fine-tune your program's performance. Sentry's profiler captures function calls and their exact locations, aggregates them, and shows you the most common code paths of your program. This highlights areas you could optimize to help increase both the performance of your code and increase user satisfaction, as well as drive down costs.

To enable profiling, set the ProfilesSampleRate:

Copied
err := sentry.Init(sentry.ClientOptions{
    Dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
    EnableTracing: true,
    TracesSampleRate: 1.0,
+   ProfilesSampleRate: 1.0,
})

The ProfilesSampleRate setting is relative to the TracesSampleRate setting.

For Profiling to work, you have to first enable Sentry’s tracing via TracesSampleRate (like in the example above). Read our tracing setup documentation to learn how to configure sampling. If you set your sample rate to 1.0, all transactions will be captured.

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").