Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions static/app/components/onboarding/productSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export const platformProductAvailability = {
ProductSolution.LOGS,
ProductSolution.METRICS,
],
native: [ProductSolution.PERFORMANCE_MONITORING],
node: [
ProductSolution.PERFORMANCE_MONITORING,
ProductSolution.PROFILING,
Expand Down Expand Up @@ -395,6 +396,8 @@ export const platformProductAvailability = {
ProductSolution.PROFILING,
ProductSolution.LOGS,
],
unity: [ProductSolution.PERFORMANCE_MONITORING],
unreal: [ProductSolution.PERFORMANCE_MONITORING],
} as Record<PlatformKey, ProductSolution[]>;

type ProductProps = {
Expand Down
49 changes: 48 additions & 1 deletion static/app/gettingStartedDocs/native/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ 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, "[email protected]");
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);`
: ''
}
sentry_init(options);

/* ... */
Expand Down Expand Up @@ -106,6 +113,46 @@ 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: (
<ExternalLink href="https://docs.sentry.io/platforms/native/tracing/" />
),
}
),
},
],
},
] satisfies OnboardingStep[])
: []),
...([getConsoleExtensions(params)].filter(Boolean) as OnboardingStep[]),
],
};
61 changes: 60 additions & 1 deletion static/app/gettingStartedDocs/unity/onboarding.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -57,6 +58,19 @@ 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: <code />}
),
},
],
},
{
type: 'text',
text: tct(
Expand All @@ -71,7 +85,7 @@ export const onboarding: OnboardingConfig = {
],
},
],
verify: params => [
verify: (params: DocsParams) => [
{
type: StepType.VERIFY,
content: [
Expand All @@ -88,6 +102,51 @@ 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: (
<ExternalLink href="https://docs.sentry.io/platforms/unity/tracing/" />
),
}
),
},
],
},
] satisfies OnboardingStep[])
: []),
{
title: t('Troubleshooting'),
content: [
Expand Down
68 changes: 67 additions & 1 deletion static/app/gettingStartedDocs/unreal/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ 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;`
: ''
}
}

...
Expand Down Expand Up @@ -110,6 +118,19 @@ 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: <strong />}
),
},
],
},
{
type: 'text',
text: tct(
Expand Down Expand Up @@ -142,6 +163,51 @@ 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<USentrySubsystem>();

// 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: (
<ExternalLink href="https://docs.sentry.io/platforms/unreal/tracing/" />
),
}
),
},
],
},
] satisfies OnboardingStep[])
: []),
{
title: t('Crash Reporter Client'),
content: [
Expand Down
Loading