Set Up Profiling
With profiling, Sentry allows you to collect and analyze performance profiles from real user devices in production to give you a complete picture of how your application performs in a variety of environments.
Enable Performance Monitoring
Profiling depends on Sentry’s performance monitoring product being enabled beforehand. To enable performance monitoring in the SDK:
import Sentry
SentrySDK.start { options in
options.dsn = "https://examplePublicKey@o0.ingest.sentry.io/0"
options.tracesSampleRate = 1.0
}
Check out the performance setup documentation for more detailed information on how to configure sampling. Setting the sample rate to 1.0 means all transactions will be captured.
By default, some transactions will be created automatically for common operations like loading a view controller/activity and app startup.
Enable Profiling
iOS profiling is available starting in SDK version 8.12.0
.
import Sentry
SentrySDK.start { options in
options.dsn = "https://examplePublicKey@o0.ingest.sentry.io/0"
options.tracesSampleRate = 1.0 // tracing must be enabled for profiling
options.profilesSampleRate = 1.0 // see also `profilesSampler` if you need custom sampling logic
}
The profilesSampleRate
setting is relative to the tracesSampleRate
setting.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
- Package:
- cocoapods:sentry-cocoa
- Version:
- 8.13.0
- Repository:
- https://github.com/getsentry/sentry-cocoa