diff --git a/src/docs/product/profiling/getting-started.mdx b/src/docs/product/profiling/getting-started.mdx index 8b5df580c25c0..729008583a130 100644 --- a/src/docs/product/profiling/getting-started.mdx +++ b/src/docs/product/profiling/getting-started.mdx @@ -20,9 +20,10 @@ Profiling depends on Sentry's performance monitoring product being enabled befor - Mobile - [Android](/platforms/android/profiling/) - [iOS](/platforms/apple/guides/ios/profiling/) -- Server - - [Node.js](/platforms/node/profiling) +- Standalone and server apps + - [Node.js](/platforms/node/profiling/) - [Python](/platforms/python/profiling/) - [PHP](/platforms/php/profiling/) + - [Go](/platforms/go/profiling/) [experimental] - [Ruby](/platforms/ruby/profiling/) [experimental] - [Rust](/platforms/rust/profiling) [experimental] diff --git a/src/docs/product/profiling/index.mdx b/src/docs/product/profiling/index.mdx index 2963747cf7ea0..51feb69116861 100644 --- a/src/docs/product/profiling/index.mdx +++ b/src/docs/product/profiling/index.mdx @@ -15,6 +15,7 @@ description: "Profiling offers a deeper level of visibility on top of traditiona - Node.js - Python - PHP (including Laravel and Symfony) +- Go [experimental] - Ruby [experimental] - Rust [experimental] diff --git a/src/platforms/common/profiling/index.mdx b/src/platforms/common/profiling/index.mdx index 4b2bd99b78038..6259ffac88f17 100644 --- a/src/platforms/common/profiling/index.mdx +++ b/src/platforms/common/profiling/index.mdx @@ -4,6 +4,7 @@ sidebar_order: 5000 supported: - android - apple + - go - python - rust - ruby @@ -19,7 +20,6 @@ notSupported: - java - java.spring-boot - java.spring - - go - javascript.cordova - native.breakpad - native.crashpad @@ -29,6 +29,16 @@ notSupported: description: "Learn how to enable profiling in your app if it is not already set up." --- + + + + +Go Profiling is currently in alpha. Alpha features are still in progress and may have bugs. We recognize the irony. + + + + + @@ -90,6 +100,19 @@ In `AndroidManifest.xml`: + + +```go +err := sentry.Init(sentry.ClientOptions{ + Dsn: "___PUBLIC_DSN___", + EnableTracing: true, + // We recommend adjusting this value in production: + TracesSampleRate: 1.0, +}) +``` + + + ```python @@ -251,6 +274,29 @@ sentry_sdk.init( + + + + +Go Profiling alpha is available since SDK version `0.22.0`. + + + +To enable profiling, set the `ProfilesSampleRate`: + +```go +err := sentry.Init(sentry.ClientOptions{ + Dsn: "___PUBLIC_DSN___", + EnableTracing: true, + // We recommend adjusting these values in production: + TracesSampleRate: 1.0, + // The sampling rate for profiling is relative to TracesSampleRate: + ProfilesSampleRate: 1.0, +}) +``` + + + @@ -337,6 +383,17 @@ If you don't see any profiling data in [sentry.io](https://sentry.io), you can t - If the automatic instrumentation is not sending performance data, try using custom instrumentation. - Enable debug mode in the SDK and check the logs. + + +### Limitations + +Profile samples are collected periodically for each goroutine. +If your program uses a large number of concurrent goroutines, make sure to check whether the overhead is within the acceptable range for your use case. + +As always, and especially with Profiling in Go being an alpha feature, feedback is welcome on [Discord](https://discord.com/channels/621778831602221064/621786587939864586) or [GitHub](https://github.com/getsentry/sentry-go/issues/630). + + + ### Limitations diff --git a/src/wizard/go/profiling-onboarding/go/0.alert.md b/src/wizard/go/profiling-onboarding/go/0.alert.md new file mode 100644 index 0000000000000..cd26fd8cec824 --- /dev/null +++ b/src/wizard/go/profiling-onboarding/go/0.alert.md @@ -0,0 +1,10 @@ +--- +name: Go +doc_link: https://docs.sentry.io/platforms/go/profiling/ +support_level: alpha +type: language +--- + +
+Profiling in Go is currently in alpha, and there may be some bugs. We recognize the irony. +
diff --git a/src/wizard/go/profiling-onboarding/go/1.install.md b/src/wizard/go/profiling-onboarding/go/1.install.md new file mode 100644 index 0000000000000..cc61bf3b87bad --- /dev/null +++ b/src/wizard/go/profiling-onboarding/go/1.install.md @@ -0,0 +1,10 @@ +--- +name: Go +doc_link: https://docs.sentry.io/platforms/go/profiling/ +support_level: alpha +type: language +--- + +#### Install + +For the Profiling integration to work, you must have the Sentry Go SDK module (minimum version v0.22.0). Learn more about installation methods in our [full documentation](https://docs.sentry.io/platforms/go/#install). diff --git a/src/wizard/go/profiling-onboarding/go/2.configure-performance.md b/src/wizard/go/profiling-onboarding/go/2.configure-performance.md new file mode 100644 index 0000000000000..36b7308aab523 --- /dev/null +++ b/src/wizard/go/profiling-onboarding/go/2.configure-performance.md @@ -0,0 +1,19 @@ +--- +name: Go +doc_link: https://docs.sentry.io/platforms/go/profiling/ +support_level: alpha +type: language +--- + +#### Configure Performance + +Sentry’s performance monitoring product has to be enabled in order for Profiling to work. To enable performance monitoring in the SDK: + +```go +err := sentry.Init(sentry.ClientOptions{ + Dsn: "___PUBLIC_DSN___", + EnableTracing: true, + // We recommend adjusting this value in production: + TracesSampleRate: 1.0, +}) +``` diff --git a/src/wizard/go/profiling-onboarding/go/3.configure-profiling.md b/src/wizard/go/profiling-onboarding/go/3.configure-profiling.md new file mode 100644 index 0000000000000..aaf4ef500cfed --- /dev/null +++ b/src/wizard/go/profiling-onboarding/go/3.configure-profiling.md @@ -0,0 +1,21 @@ +--- +name: Go +doc_link: https://docs.sentry.io/platforms/go/profiling/ +support_level: alpha +type: language +--- + +#### Configure Profiling + +Add the `ProfilesSampleRate` option to your SDK config. + +```go +err := sentry.Init(sentry.ClientOptions{ + Dsn: "___PUBLIC_DSN___", + EnableTracing: true, + // We recommend adjusting these values in production: + TracesSampleRate: 1.0, + // The sampling rate for profiling is relative to TracesSampleRate: + ProfilesSampleRate: 1.0, +}) +```