From beb69a434176eadddc7dfc571305a485fb1d811d Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:17:28 +0100 Subject: [PATCH 1/6] add to withLoggingOnboarding --- static/app/data/platformCategories.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/app/data/platformCategories.tsx b/static/app/data/platformCategories.tsx index 99bec1259a5b12..6d6f7f1500dcb1 100644 --- a/static/app/data/platformCategories.tsx +++ b/static/app/data/platformCategories.tsx @@ -304,7 +304,10 @@ export const withLoggingOnboarding: Set = new Set([ 'apple-ios', 'apple-macos', 'bun', + 'cocoa-objc', + 'cocoa-swift', 'dart', + 'dotnet', 'flutter', 'go', 'go-echo', @@ -336,6 +339,7 @@ export const withLoggingOnboarding: Set = new Set([ 'javascript-sveltekit', 'javascript-tanstackstart-react', 'javascript-vue', + 'native', 'node', 'node-azurefunctions', 'node-connect', @@ -350,6 +354,7 @@ export const withLoggingOnboarding: Set = new Set([ 'node-nestjs', 'php', 'php-laravel', + 'php-symfony', 'python', 'python-aiohttp', 'python-asgi', @@ -376,6 +381,8 @@ export const withLoggingOnboarding: Set = new Set([ 'ruby-rack', 'ruby-rails', 'rust', + 'unity', + 'unreal', ]); // List of platforms that do not have logging support. We make use of this list in the product to not provide any Logging From d99c0cd324742a778eb222f6c125bf389f53b218 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:38:36 +0100 Subject: [PATCH 2/6] add native logs onboarding --- .../app/gettingStartedDocs/native/index.tsx | 2 + static/app/gettingStartedDocs/native/logs.tsx | 86 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 static/app/gettingStartedDocs/native/logs.tsx diff --git a/static/app/gettingStartedDocs/native/index.tsx b/static/app/gettingStartedDocs/native/index.tsx index 9b3b3c93f62de5..7ebe9ffdecf519 100644 --- a/static/app/gettingStartedDocs/native/index.tsx +++ b/static/app/gettingStartedDocs/native/index.tsx @@ -1,11 +1,13 @@ import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types'; import {CrashReportWebApiOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding'; +import {logs} from './logs'; import {onboarding} from './onboarding'; const docs: Docs = { onboarding, crashReportOnboarding: CrashReportWebApiOnboarding, + logsOnboarding: logs, }; export default docs; diff --git a/static/app/gettingStartedDocs/native/logs.tsx b/static/app/gettingStartedDocs/native/logs.tsx new file mode 100644 index 00000000000000..4f12ab7078f6bb --- /dev/null +++ b/static/app/gettingStartedDocs/native/logs.tsx @@ -0,0 +1,86 @@ +import {ExternalLink} from 'sentry/components/core/link'; +import type { + DocsParams, + OnboardingConfig, +} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {tct} from 'sentry/locale'; + +type Params = DocsParams; + +export const logs: OnboardingConfig = { + install: () => [ + { + type: StepType.INSTALL, + content: [ + { + type: 'text', + text: tct( + 'Logs in Native are supported in Sentry Native SDK version [link:0.11.1] and above.', + { + link: ( + + ), + } + ), + }, + ], + }, + ], + configure: (params: Params) => [ + { + type: StepType.CONFIGURE, + content: [ + { + type: 'text', + text: tct( + 'To enable logging, you need to initialize the SDK with the [code:enable_logs] option set to [code:true].', + { + code: , + } + ), + }, + { + type: 'code', + language: 'c', + code: `sentry_options_t *options = sentry_options_new(); +sentry_options_set_dsn(options, "${params.dsn.public}"); +sentry_options_set_enable_logs(options, 1); +// set other options +sentry_init(options);`, + }, + ], + }, + ], + verify: () => [ + { + type: StepType.VERIFY, + content: [ + { + type: 'text', + text: tct( + 'Once the feature is enabled on the SDK and the SDK is initialized, you can send logs using the [code:sentry_log_X()] APIs.', + { + code: , + } + ), + }, + { + type: 'text', + text: tct( + 'The API exposes six methods that you can use to log messages at different log levels: [code:trace], [code:debug], [code:info], [code:warn], [code:error], and [code:fatal].', + { + code: , + } + ), + }, + { + type: 'code', + language: 'c', + code: `sentry_log_info("A simple log message"); +sentry_log_error("A %s log message", "formatted");`, + }, + ], + }, + ], +}; From b78c66f5df673ff9ee25d93913ebb40386bab385 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:52:59 +0100 Subject: [PATCH 3/6] Add logs onboarding for dotnet, symfony and unreal --- .../app/gettingStartedDocs/dotnet/index.tsx | 2 + static/app/gettingStartedDocs/dotnet/logs.tsx | 90 +++++++++++++++ .../gettingStartedDocs/php-symfony/index.tsx | 2 + .../gettingStartedDocs/php-symfony/logs.tsx | 104 ++++++++++++++++++ .../app/gettingStartedDocs/unreal/index.tsx | 2 + static/app/gettingStartedDocs/unreal/logs.tsx | 102 +++++++++++++++++ 6 files changed, 302 insertions(+) create mode 100644 static/app/gettingStartedDocs/dotnet/logs.tsx create mode 100644 static/app/gettingStartedDocs/php-symfony/logs.tsx create mode 100644 static/app/gettingStartedDocs/unreal/logs.tsx diff --git a/static/app/gettingStartedDocs/dotnet/index.tsx b/static/app/gettingStartedDocs/dotnet/index.tsx index acb003a7796e8a..dcf7712ca3498b 100644 --- a/static/app/gettingStartedDocs/dotnet/index.tsx +++ b/static/app/gettingStartedDocs/dotnet/index.tsx @@ -2,6 +2,7 @@ import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types'; import {crashReport} from './crashReport'; import {feedback} from './feedback'; +import {logs} from './logs'; import {onboarding} from './onboarding'; import {profiling} from './profiling'; @@ -10,6 +11,7 @@ const docs: Docs = { feedbackOnboardingCrashApi: feedback, crashReportOnboarding: crashReport, profilingOnboarding: profiling, + logsOnboarding: logs, }; export default docs; diff --git a/static/app/gettingStartedDocs/dotnet/logs.tsx b/static/app/gettingStartedDocs/dotnet/logs.tsx new file mode 100644 index 00000000000000..ceacd8f3f26174 --- /dev/null +++ b/static/app/gettingStartedDocs/dotnet/logs.tsx @@ -0,0 +1,90 @@ +import {ExternalLink} from 'sentry/components/core/link'; +import type { + DocsParams, + OnboardingConfig, +} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {t, tct} from 'sentry/locale'; + +type Params = DocsParams; + +export const logs: OnboardingConfig = { + install: () => [ + { + type: StepType.INSTALL, + content: [ + { + type: 'text', + text: tct( + 'Logs in .NET are supported in Sentry .NET SDK version [code:5.14.0] and above.', + { + code: , + } + ), + }, + ], + }, + ], + configure: (params: Params) => [ + { + type: StepType.CONFIGURE, + content: [ + { + type: 'text', + text: tct( + 'To enable logging, you need to initialize the SDK with the [code:Experimental.EnableLogs] option set to [code:true].', + { + code: , + } + ), + }, + { + type: 'code', + language: 'csharp', + code: `SentrySdk.Init(options => +{ + options.Dsn = "${params.dsn.public}"; + // Enable logs to be sent to Sentry + options.Experimental.EnableLogs = true; +});`, + }, + ], + }, + ], + verify: () => [ + { + type: StepType.VERIFY, + content: [ + { + type: 'text', + text: t( + 'Once the feature is enabled on the SDK and the SDK is initialized, you can send logs using the SentrySdk.Logger APIs.' + ), + }, + { + type: 'text', + text: t( + 'The SentrySdk.Logger instance exposes six methods that you can use to log messages at different log levels: Trace, Debug, Info, Warning, Error, and Fatal.' + ), + }, + { + type: 'code', + language: 'csharp', + code: `SentrySdk.Logger.LogInfo("A simple log message"); +SentrySdk.Logger.LogError("A {0} log message", "formatted");`, + }, + { + type: 'text', + text: tct( + 'You can also attach custom attributes via a delegate. For more information, see the [link:Integrations documentation].', + { + link: ( + + ), + } + ), + }, + ], + }, + ], +}; diff --git a/static/app/gettingStartedDocs/php-symfony/index.tsx b/static/app/gettingStartedDocs/php-symfony/index.tsx index 309eadd4a70e0f..f6684ae784ed03 100644 --- a/static/app/gettingStartedDocs/php-symfony/index.tsx +++ b/static/app/gettingStartedDocs/php-symfony/index.tsx @@ -5,6 +5,7 @@ import { } from 'sentry/gettingStartedDocs/javascript/jsLoader'; import {crashReport} from './crashReport'; +import {logs} from './logs'; import {onboarding} from './onboarding'; import {profiling} from './profiling'; @@ -14,6 +15,7 @@ const docs: Docs = { profilingOnboarding: profiling, crashReportOnboarding: crashReport, feedbackOnboardingJsLoader, + logsOnboarding: logs, }; export default docs; diff --git a/static/app/gettingStartedDocs/php-symfony/logs.tsx b/static/app/gettingStartedDocs/php-symfony/logs.tsx new file mode 100644 index 00000000000000..dcde53cc81bada --- /dev/null +++ b/static/app/gettingStartedDocs/php-symfony/logs.tsx @@ -0,0 +1,104 @@ +import {ExternalLink} from 'sentry/components/core/link'; +import type { + DocsParams, + OnboardingConfig, +} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {t, tct} from 'sentry/locale'; + +type Params = DocsParams; + +export const logs: OnboardingConfig = { + install: () => [ + { + type: StepType.INSTALL, + content: [ + { + type: 'text', + text: tct( + 'Logs for Symfony are supported in version [code:4.12.0] and above of the Sentry PHP SDK and version [code:5.10.0] and above of the [code:sentry-symfony] bundle.', + { + code: , + } + ), + }, + { + type: 'text', + text: t('Make sure you have the latest version of the Sentry Symfony bundle:'), + }, + { + type: 'code', + language: 'bash', + code: 'composer require sentry/sentry-symfony', + }, + ], + }, + ], + configure: (params: Params) => [ + { + type: StepType.CONFIGURE, + content: [ + { + type: 'text', + text: tct( + 'To enable logging, add the [code:enable_logs] option to your Sentry configuration:', + { + code: , + } + ), + }, + { + type: 'code', + language: 'yaml', + code: `# config/packages/sentry.yaml +sentry: + dsn: '${params.dsn.public}' + options: + enable_logs: true`, + }, + { + type: 'text', + text: tct( + 'For integration with Monolog, see the [link:Symfony Logs documentation].', + { + link: ( + + ), + } + ), + }, + ], + }, + ], + verify: () => [ + { + type: StepType.VERIFY, + content: [ + { + type: 'text', + text: t( + 'Once configured, you can send logs using the standard PSR-3 logger interface:' + ), + }, + { + type: 'code', + language: 'php', + code: `use Psr\\Log\\LoggerInterface; + +class SomeService +{ + public function __construct( + private LoggerInterface $logger + ) {} + + public function someMethod(): void + { + $this->logger->info('A test log message'); + $this->logger->error('An error log message', ['context' => 'value']); + } +}`, + }, + ], + }, + ], +}; diff --git a/static/app/gettingStartedDocs/unreal/index.tsx b/static/app/gettingStartedDocs/unreal/index.tsx index 6c1e6b06917266..2d9adc901245c9 100644 --- a/static/app/gettingStartedDocs/unreal/index.tsx +++ b/static/app/gettingStartedDocs/unreal/index.tsx @@ -1,12 +1,14 @@ import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types'; import {crashReport} from './crashReport'; +import {logs} from './logs'; import {onboarding} from './onboarding'; const docs: Docs = { onboarding, feedbackOnboardingCrashApi: crashReport, crashReportOnboarding: crashReport, + logsOnboarding: logs, }; export default docs; diff --git a/static/app/gettingStartedDocs/unreal/logs.tsx b/static/app/gettingStartedDocs/unreal/logs.tsx new file mode 100644 index 00000000000000..c1950ac92bcaf6 --- /dev/null +++ b/static/app/gettingStartedDocs/unreal/logs.tsx @@ -0,0 +1,102 @@ +import {ExternalLink} from 'sentry/components/core/link'; +import type { + DocsParams, + OnboardingConfig, +} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; +import {t, tct} from 'sentry/locale'; + +type Params = DocsParams; + +export const logs: OnboardingConfig = { + install: () => [ + { + type: StepType.INSTALL, + content: [ + { + type: 'text', + text: tct( + 'Logs for Unreal Engine are supported in Sentry Unreal Engine SDK version [code:1.2.0] and above.', + { + code: , + } + ), + }, + ], + }, + ], + configure: (params: Params) => [ + { + type: StepType.CONFIGURE, + content: [ + { + type: 'text', + text: t( + 'To enable logging in your Unreal Engine project, you need to configure the Sentry SDK with structured logging enabled.' + ), + }, + { + type: 'text', + text: tct( + 'Open your project settings: [strong:Project Settings > Plugins > Sentry] and check the [strong:Enable Structured Logging] option.', + { + strong: , + } + ), + }, + { + type: 'text', + text: t('Alternatively, you can enable logging programmatically:'), + }, + { + type: 'code', + language: 'cpp', + code: `#include "SentrySubsystem.h" + +USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +// Create settings with logging enabled +SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings) +{ + Settings->Dsn = TEXT("${params.dsn.public}"); + Settings->EnableStructuredLogging = true; +}));`, + }, + ], + }, + ], + verify: () => [ + { + type: StepType.VERIFY, + content: [ + { + type: 'text', + text: t( + 'Once structured logging is enabled, you can send logs using the AddLog method on the Sentry subsystem.' + ), + }, + { + type: 'code', + language: 'cpp', + code: `USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +// Send logs at different severity levels +SentrySubsystem->AddLog(TEXT("A simple log message"), ESentryLevel::Info, TEXT("GameFlow")); +SentrySubsystem->AddLog(TEXT("Failed to save game data"), ESentryLevel::Error, TEXT("SaveSystem"));`, + }, + { + type: 'text', + text: tct( + 'You can also automatically capture Unreal Engine [code:UE_LOG] calls. For more information, see the [link:Automatic UE_LOG Integration documentation].', + { + code: , + link: ( + + ), + } + ), + }, + ], + }, + ], +}; From adb31a181a043b260b0f45741c90819f09b736c0 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:44:30 +0100 Subject: [PATCH 4/6] add tracing to native/unity/unreal --- .../onboarding/productSelection.tsx | 15 ++- .../gettingStartedDocs/dotnet/onboarding.tsx | 39 ++++++ .../gettingStartedDocs/native/onboarding.tsx | 86 +++++++++++- .../php-symfony/onboarding.tsx | 49 ++++++- .../gettingStartedDocs/php-symfony/utils.tsx | 16 ++- .../gettingStartedDocs/unity/onboarding.tsx | 110 +++++++++++++++- .../gettingStartedDocs/unreal/onboarding.tsx | 124 +++++++++++++++++- 7 files changed, 430 insertions(+), 9 deletions(-) diff --git a/static/app/components/onboarding/productSelection.tsx b/static/app/components/onboarding/productSelection.tsx index a25c32cb643385..f6c7f68cd0d55d 100644 --- a/static/app/components/onboarding/productSelection.tsx +++ b/static/app/components/onboarding/productSelection.tsx @@ -93,7 +93,11 @@ export const platformProductAvailability = { 'apple-macos': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING], bun: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.LOGS], capacitor: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.SESSION_REPLAY], - dotnet: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING], + dotnet: [ + ProductSolution.PERFORMANCE_MONITORING, + ProductSolution.PROFILING, + ProductSolution.LOGS, + ], 'dotnet-aspnet': [ProductSolution.PERFORMANCE_MONITORING], 'dotnet-aspnetcore': [ProductSolution.PERFORMANCE_MONITORING], 'dotnet-awslambda': [ProductSolution.PERFORMANCE_MONITORING], @@ -187,6 +191,7 @@ export const platformProductAvailability = { ProductSolution.LOGS, ProductSolution.METRICS, ], + native: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.LOGS], node: [ ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING, @@ -272,7 +277,11 @@ export const platformProductAvailability = { ProductSolution.PROFILING, ProductSolution.LOGS, ], - 'php-symfony': [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING], + 'php-symfony': [ + ProductSolution.PERFORMANCE_MONITORING, + ProductSolution.PROFILING, + ProductSolution.LOGS, + ], python: [ ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING, @@ -396,6 +405,8 @@ export const platformProductAvailability = { ProductSolution.PROFILING, ProductSolution.LOGS, ], + unity: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.LOGS], + unreal: [ProductSolution.PERFORMANCE_MONITORING, ProductSolution.LOGS], } as Record; type ProductProps = { diff --git a/static/app/gettingStartedDocs/dotnet/onboarding.tsx b/static/app/gettingStartedDocs/dotnet/onboarding.tsx index 5b66ae7c48029a..07b03580783e82 100644 --- a/static/app/gettingStartedDocs/dotnet/onboarding.tsx +++ b/static/app/gettingStartedDocs/dotnet/onboarding.tsx @@ -77,6 +77,13 @@ SentrySdk.Init(options => ));` }` : '' + }${ + params.isLogsSelected + ? ` + + // Enable logs to be sent to Sentry + options.EnableLogs = true;` + : '' } });`; @@ -255,6 +262,38 @@ export const onboarding: OnboardingConfig = { }, ] satisfies OnboardingStep[]) : []), + ...(params.isLogsSelected + ? ([ + { + title: t('Logs'), + content: [ + { + type: 'text', + text: t( + 'Once configured, you can send logs using the SentrySdk.Logger APIs:' + ), + }, + { + type: 'code', + language: 'csharp', + code: `SentrySdk.Logger.LogInfo("A simple log message"); +SentrySdk.Logger.LogError("A {0} log message", "formatted");`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the Logs documentation] to learn more about custom attributes and integrations.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), { title: t('Samples'), content: [ diff --git a/static/app/gettingStartedDocs/native/onboarding.tsx b/static/app/gettingStartedDocs/native/onboarding.tsx index fcbef9ee1f1d25..5c9717064506a5 100644 --- a/static/app/gettingStartedDocs/native/onboarding.tsx +++ b/static/app/gettingStartedDocs/native/onboarding.tsx @@ -19,7 +19,19 @@ int main(void) { // https://docs.sentry.io/platforms/native/configuration/options/#database-path sentry_options_set_database_path(options, ".sentry-native"); sentry_options_set_release(options, "my-project-name@2.3.12"); - sentry_options_set_debug(options, 1); + sentry_options_set_debug(options, 1);${ + params.isPerformanceSelected + ? ` + // Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing. + // We recommend adjusting this value in production. + sentry_options_set_traces_sample_rate(options, 1.0);` + : '' + }${ + params.isLogsSelected + ? ` + sentry_options_set_enable_logs(options, 1);` + : '' + } sentry_init(options); /* ... */ @@ -106,6 +118,78 @@ export const onboarding: OnboardingConfig = { }, ], }, + ...(params.isPerformanceSelected + ? ([ + { + title: t('Tracing'), + content: [ + { + type: 'text', + text: t( + 'You can measure the performance of your code by capturing transactions and spans.' + ), + }, + { + type: 'code', + language: 'c', + code: `sentry_transaction_context_t *tx_ctx = sentry_transaction_context_new( + "test-transaction", + "test-operation" +); +sentry_transaction_t *tx = sentry_transaction_start(tx_ctx, NULL); + +// Perform your operation +// ... + +sentry_transaction_finish(tx);`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the documentation] to learn more about tracing and custom instrumentation.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), + ...(params.isLogsSelected + ? ([ + { + title: t('Logs'), + content: [ + { + type: 'text', + text: t( + 'Once logging is enabled, you can send logs using the sentry_log_X() APIs:' + ), + }, + { + type: 'code', + language: 'c', + code: `sentry_log_info("A simple log message"); +sentry_log_error("A %s log message", "formatted");`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the Logs documentation] to learn more about additional attributes and options.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), ...([getConsoleExtensions(params)].filter(Boolean) as OnboardingStep[]), ], }; diff --git a/static/app/gettingStartedDocs/php-symfony/onboarding.tsx b/static/app/gettingStartedDocs/php-symfony/onboarding.tsx index bf3b226f70bd63..f4c0bc3cfd8603 100644 --- a/static/app/gettingStartedDocs/php-symfony/onboarding.tsx +++ b/static/app/gettingStartedDocs/php-symfony/onboarding.tsx @@ -2,9 +2,10 @@ import {ExternalLink} from 'sentry/components/core/link'; import type { DocsParams, OnboardingConfig, + OnboardingStep, } from 'sentry/components/onboarding/gettingStartedDoc/types'; import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types'; -import {tct} from 'sentry/locale'; +import {t, tct} from 'sentry/locale'; import {getConfigureSnippet, getExcimerInstallSteps} from './utils'; @@ -66,7 +67,7 @@ SENTRY_DSN="${params.dsn.public}" ], }, ], - verify: () => [ + verify: (params: DocsParams) => [ { type: StepType.VERIFY, content: [ @@ -116,6 +117,50 @@ SENTRY_DSN="${params.dsn.public}" }, ], }, + ...(params.isLogsSelected + ? ([ + { + title: t('Logs'), + content: [ + { + type: 'text', + text: t( + 'Once configured, you can send logs using the standard PSR-3 logger interface:' + ), + }, + { + type: 'code', + language: 'php', + code: `use Psr\\Log\\LoggerInterface; + +class SomeService +{ + public function __construct( + private LoggerInterface $logger + ) {} + + public function someMethod(): void + { + $this->logger->info('A test log message'); + $this->logger->error('An error log message', ['context' => 'value']); + } +}`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the Logs documentation] to learn more about Monolog integration.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), ], nextSteps: () => [], }; diff --git a/static/app/gettingStartedDocs/php-symfony/utils.tsx b/static/app/gettingStartedDocs/php-symfony/utils.tsx index 5c1fa9c6a80644..9adde5433c6646 100644 --- a/static/app/gettingStartedDocs/php-symfony/utils.tsx +++ b/static/app/gettingStartedDocs/php-symfony/utils.tsx @@ -35,7 +35,11 @@ export const getExcimerInstallSteps = (params: DocsParams): ContentBlock[] => { }; export const getConfigureSnippet = (params: DocsParams): ContentBlock[] => { - if (!params.isPerformanceSelected && !params.isProfilingSelected) { + if ( + !params.isPerformanceSelected && + !params.isProfilingSelected && + !params.isLogsSelected + ) { return []; } @@ -53,7 +57,9 @@ export const getConfigureSnippet = (params: DocsParams): ContentBlock[] => { code: `when@prod: sentry: dsn: '%env(SENTRY_DSN)%'${ - params.isPerformanceSelected || params.isProfilingSelected + params.isPerformanceSelected || + params.isProfilingSelected || + params.isLogsSelected ? ` options:` : '' @@ -69,6 +75,12 @@ export const getConfigureSnippet = (params: DocsParams): ContentBlock[] => { # Set a sampling rate for profiling - this is relative to traces_sample_rate profiles_sample_rate: 1.0` : '' + }${ + params.isLogsSelected + ? ` + # Enable logs to be sent to Sentry + enable_logs: true` + : '' }`, }, ]; diff --git a/static/app/gettingStartedDocs/unity/onboarding.tsx b/static/app/gettingStartedDocs/unity/onboarding.tsx index ad557890dc7ce8..4284b34cfef2c8 100644 --- a/static/app/gettingStartedDocs/unity/onboarding.tsx +++ b/static/app/gettingStartedDocs/unity/onboarding.tsx @@ -1,6 +1,7 @@ import {ExternalLink} from 'sentry/components/core/link'; import {StoreCrashReportsConfig} from 'sentry/components/onboarding/gettingStartedDoc/storeCrashReportsConfig'; import type { + DocsParams, OnboardingConfig, OnboardingStep, } from 'sentry/components/onboarding/gettingStartedDoc/types'; @@ -57,6 +58,32 @@ export const onboarding: OnboardingConfig = { type: 'text', text: t("And that's it! Now Sentry can capture errors automatically."), }, + { + type: 'conditional', + condition: params.isPerformanceSelected, + content: [ + { + type: 'text', + text: tct( + 'To enable performance monitoring, set the [code:TracesSampleRate] option in the Sentry configuration window. For example, set it to [code:1.0] to capture 100% of transactions.', + {code: } + ), + }, + ], + }, + { + type: 'conditional', + condition: params.isLogsSelected, + content: [ + { + type: 'text', + text: tct( + 'To enable structured logging, check the [code:Enable Logs] option in the Sentry configuration window.', + {code: } + ), + }, + ], + }, { type: 'text', text: tct( @@ -71,7 +98,7 @@ export const onboarding: OnboardingConfig = { ], }, ], - verify: params => [ + verify: (params: DocsParams) => [ { type: StepType.VERIFY, content: [ @@ -88,6 +115,87 @@ export const onboarding: OnboardingConfig = { }, ], }, + ...(params.isPerformanceSelected + ? ([ + { + title: t('Tracing'), + content: [ + { + type: 'text', + text: t( + 'You can measure the performance of your code by capturing transactions and spans.' + ), + }, + { + type: 'code', + language: 'csharp', + code: `using Sentry; + +// Transaction can be started by providing, at minimum, the name and the operation +var transaction = SentrySdk.StartTransaction( + "test-transaction-name", + "test-transaction-operation" +); + +// Transactions can have child spans (and those spans can have child spans as well) +var span = transaction.StartChild("test-child-operation"); + +// ... Perform the operation + +span.Finish(); // Mark the span as finished +transaction.Finish(); // Mark the transaction as finished and send it to Sentry`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the documentation] to learn more about the API and automatic instrumentations.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), + ...(params.isLogsSelected + ? ([ + { + title: t('Logs'), + content: [ + { + type: 'text', + text: t( + 'Once logging is enabled, you can send logs using the Debug.Log API or directly via the SDK:' + ), + }, + { + type: 'code', + language: 'csharp', + code: `using Sentry; +using UnityEngine; + +// Unity's Debug.Log will automatically be captured +Debug.Log("This log will be sent to Sentry"); + +// Or use the SDK directly +SentrySdk.Logger.LogInfo("A simple log message"); +SentrySdk.Logger.LogError("An error log message");`, + }, + { + type: 'text', + text: tct('Check out [link:the Logs documentation] to learn more.', { + link: ( + + ), + }), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), { title: t('Troubleshooting'), content: [ diff --git a/static/app/gettingStartedDocs/unreal/onboarding.tsx b/static/app/gettingStartedDocs/unreal/onboarding.tsx index cdfd3b21c1cf0f..94bdc79413a10a 100644 --- a/static/app/gettingStartedDocs/unreal/onboarding.tsx +++ b/static/app/gettingStartedDocs/unreal/onboarding.tsx @@ -39,7 +39,22 @@ void UMyGameInstance::ConfigureSentrySettings(USentrySettings* Settings) Settings->SendDefaultPii = true; // If your game/app doesn't have sensitive data, you can get screenshots on error events automatically - Settings->AttachScreenshot = true; + Settings->AttachScreenshot = true;${ + params.isPerformanceSelected + ? ` + + // Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing. + // We recommend adjusting this value in production. + Settings->TracesSampleRate = 1.0f;` + : '' + }${ + params.isLogsSelected + ? ` + + // Enable structured logging + Settings->EnableStructuredLogging = true;` + : '' + } } ... @@ -110,6 +125,32 @@ export const onboarding: OnboardingConfig = { language: 'url', code: params.dsn.public, }, + { + type: 'conditional', + condition: params.isPerformanceSelected, + content: [ + { + type: 'text', + text: tct( + 'To enable performance monitoring, set the [strong:Traces Sample Rate] option in the Sentry configuration window. For example, set it to [strong:1.0] to capture 100% of transactions.', + {strong: } + ), + }, + ], + }, + { + type: 'conditional', + condition: params.isLogsSelected, + content: [ + { + type: 'text', + text: tct( + 'To enable structured logging, check the [strong:Enable Structured Logging] option in the Sentry configuration window.', + {strong: } + ), + }, + ], + }, { type: 'text', text: tct( @@ -142,6 +183,87 @@ export const onboarding: OnboardingConfig = { }, ], }, + ...(params.isPerformanceSelected + ? ([ + { + title: t('Tracing'), + content: [ + { + type: 'text', + text: t( + 'You can measure the performance of your code by capturing transactions and spans.' + ), + }, + { + type: 'code', + language: 'cpp', + code: `USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +// Start a transaction +USentryTransaction* Transaction = SentrySubsystem->StartTransaction( + TEXT("test-transaction-name"), + TEXT("test-transaction-operation") +); + +// Start a child span +USentrySpan* Span = Transaction->StartChild(TEXT("test-child-operation")); + +// ... Perform your operation + +Span->Finish(); +Transaction->Finish();`, + }, + { + type: 'text', + text: tct( + 'Check out [link:the documentation] to learn more about the API and automatic instrumentations.', + { + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), + ...(params.isLogsSelected + ? ([ + { + title: t('Logs'), + content: [ + { + type: 'text', + text: t( + 'Once structured logging is enabled, you can send logs using the AddLog method on the Sentry subsystem:' + ), + }, + { + type: 'code', + language: 'cpp', + code: `USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystem(); + +// Send logs at different severity levels +SentrySubsystem->AddLog(TEXT("A simple log message"), ESentryLevel::Info, TEXT("GameFlow")); +SentrySubsystem->AddLog(TEXT("Failed to save game data"), ESentryLevel::Error, TEXT("SaveSystem"));`, + }, + { + type: 'text', + text: tct( + 'You can also automatically capture Unreal Engine [code:UE_LOG] calls. Check out [link:the Logs documentation] to learn more.', + { + code: , + link: ( + + ), + } + ), + }, + ], + }, + ] satisfies OnboardingStep[]) + : []), { title: t('Crash Reporter Client'), content: [ From a13178555819da5237196bdcbaf02f6d4d78ace5 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 15:49:26 +0100 Subject: [PATCH 5/6] fixup native onboarding - fix link - add minidump storage setting --- .../gettingStartedDocs/native/onboarding.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/static/app/gettingStartedDocs/native/onboarding.tsx b/static/app/gettingStartedDocs/native/onboarding.tsx index 5c9717064506a5..d8e559fd971aac 100644 --- a/static/app/gettingStartedDocs/native/onboarding.tsx +++ b/static/app/gettingStartedDocs/native/onboarding.tsx @@ -1,4 +1,5 @@ import {ExternalLink} from 'sentry/components/core/link'; +import {StoreCrashReportsConfig} from 'sentry/components/onboarding/gettingStartedDoc/storeCrashReportsConfig'; import type { DocsParams, OnboardingConfig, @@ -16,7 +17,7 @@ int main(void) { sentry_options_t *options = sentry_options_new(); sentry_options_set_dsn(options, "${params.dsn.public}"); // This is also the default-path. For further information and recommendations: - // https://docs.sentry.io/platforms/native/configuration/options/#database-path + // https://docs.sentry.io/platforms/native/configuration/options/#database_path sentry_options_set_database_path(options, ".sentry-native"); sentry_options_set_release(options, "my-project-name@2.3.12"); sentry_options_set_debug(options, 1);${ @@ -191,5 +192,19 @@ sentry_log_error("A %s log message", "formatted");`, ] satisfies OnboardingStep[]) : []), ...([getConsoleExtensions(params)].filter(Boolean) as OnboardingStep[]), + { + title: t('Further Settings'), + content: [ + { + type: 'custom', + content: ( + + ), + }, + ], + }, ], }; From ebda621bdb4c8b86bb38517adb47502191824d64 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 2 Dec 2025 16:31:27 +0100 Subject: [PATCH 6/6] add mock for native onboarding --- .../app/gettingStartedDocs/native/onboarding.spec.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/app/gettingStartedDocs/native/onboarding.spec.tsx b/static/app/gettingStartedDocs/native/onboarding.spec.tsx index cd9361eba8e1d6..c6fa11817f779c 100644 --- a/static/app/gettingStartedDocs/native/onboarding.spec.tsx +++ b/static/app/gettingStartedDocs/native/onboarding.spec.tsx @@ -1,10 +1,21 @@ +import {ProjectFixture} from 'sentry-fixture/project'; + import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout'; import {screen} from 'sentry-test/reactTestingLibrary'; import docs from '.'; +function renderMockRequests() { + MockApiClient.addMockResponse({ + url: '/projects/org-slug/project-slug/', + body: [ProjectFixture()], + }); +} + describe('getting started with native', () => { it('renders docs correctly', () => { + renderMockRequests(); + renderWithOnboardingLayout(docs); // Renders main headings