From 071629a8fe09dbf94169e65e6d5f2acca8b07366 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Mon, 12 Jun 2023 16:06:47 +0200 Subject: [PATCH 1/4] feat: Go profiling --- .../product/profiling/getting-started.mdx | 5 +- src/docs/product/profiling/index.mdx | 1 + src/platforms/common/profiling/index.mdx | 59 ++++++++++++++++++- .../go/profiling-onboarding/go/0.alert.md | 10 ++++ .../go/profiling-onboarding/go/1.install.md | 10 ++++ .../go/2.configure-performance.md | 19 ++++++ .../go/3.configure-profiling.md | 21 +++++++ 7 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 src/wizard/go/profiling-onboarding/go/0.alert.md create mode 100644 src/wizard/go/profiling-onboarding/go/1.install.md create mode 100644 src/wizard/go/profiling-onboarding/go/2.configure-performance.md create mode 100644 src/wizard/go/profiling-onboarding/go/3.configure-profiling.md 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..c73eb7154ab13 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 alfa feature, the 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..d778d8912e076 --- /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, +}) +``` From 903c585fbf67f2f5da1ea2c83b036119ee9ee997 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 13 Jun 2023 09:33:46 +0200 Subject: [PATCH 2/4] Update src/platforms/common/profiling/index.mdx Co-authored-by: Shana Matthews --- src/platforms/common/profiling/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/common/profiling/index.mdx b/src/platforms/common/profiling/index.mdx index c73eb7154ab13..08ab5005cceed 100644 --- a/src/platforms/common/profiling/index.mdx +++ b/src/platforms/common/profiling/index.mdx @@ -33,7 +33,7 @@ description: "Learn how to enable profiling in your app if it is not already set -Go Profiling is currently in alpha. Alpha features are still in-progress and may have bugs. We recognize the irony. +Go Profiling is currently in alpha. Alpha features are still in progress and may have bugs. We recognize the irony. From e02d8bf35203098e2104bf7583fc04d2402c427c Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Tue, 13 Jun 2023 10:52:48 +0200 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- src/platforms/common/profiling/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/common/profiling/index.mdx b/src/platforms/common/profiling/index.mdx index 08ab5005cceed..63443ced327f5 100644 --- a/src/platforms/common/profiling/index.mdx +++ b/src/platforms/common/profiling/index.mdx @@ -282,7 +282,7 @@ Go Profiling alpha is available since SDK version `0.22.0`.
-To enable profiling set the ProfilesSampleRate: +To enable profiling, set the `ProfilesSampleRate`: ```go err := sentry.Init(sentry.ClientOptions{ @@ -390,7 +390,7 @@ If you don't see any profiling data in [sentry.io](https://sentry.io), you can t 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 alfa feature, the feedback is welcome on [Discord](https://discord.com/channels/621778831602221064/621786587939864586) or [GitHub](https://github.com/getsentry/sentry-go/issues/630). +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).
From 128ed219fbc0e47eb0d5f0b91814a6a30f582e5c Mon Sep 17 00:00:00 2001 From: Anton Ovchinnikov Date: Fri, 16 Jun 2023 12:12:33 +0200 Subject: [PATCH 4/4] Linter fixes --- src/platforms/common/profiling/index.mdx | 2 +- src/wizard/go/profiling-onboarding/go/3.configure-profiling.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platforms/common/profiling/index.mdx b/src/platforms/common/profiling/index.mdx index 63443ced327f5..6259ffac88f17 100644 --- a/src/platforms/common/profiling/index.mdx +++ b/src/platforms/common/profiling/index.mdx @@ -291,7 +291,7 @@ err := sentry.Init(sentry.ClientOptions{ // We recommend adjusting these values in production: TracesSampleRate: 1.0, // The sampling rate for profiling is relative to TracesSampleRate: - ProfilesSampleRate: 1.0, + ProfilesSampleRate: 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 index d778d8912e076..aaf4ef500cfed 100644 --- a/src/wizard/go/profiling-onboarding/go/3.configure-profiling.md +++ b/src/wizard/go/profiling-onboarding/go/3.configure-profiling.md @@ -16,6 +16,6 @@ err := sentry.Init(sentry.ClientOptions{ // We recommend adjusting these values in production: TracesSampleRate: 1.0, // The sampling rate for profiling is relative to TracesSampleRate: - ProfilesSampleRate: 1.0, + ProfilesSampleRate: 1.0, }) ```