import {Alert} from 'sentry/components/core/alert';
import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import type {
Docs,
DocsParams,
OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getCrashReportModalConfigDescription,
getCrashReportModalIntroduction,
getCrashReportPHPInstallStep,
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
import {
feedbackOnboardingJsLoader,
replayOnboardingJsLoader,
} from 'sentry/gettingStartedDocs/javascript/jsLoader/jsLoader';
import {t, tct} from 'sentry/locale';
type Params = DocsParams;
const getConfigureSnippet = (params: Params) => `\\Sentry\\init([
'dsn' => '${params.dsn.public}',${
params.isPerformanceSelected
? `
// Specify a fixed sample rate
'traces_sample_rate' => 1.0,`
: ''
}${
params.isProfilingSelected
? `
// Set a sampling rate for profiling - this is relative to traces_sample_rate
'profiles_sample_rate' => 1.0,`
: ''
}
]);`;
const getVerifySnippet = () => `
try {
$this->functionFailsForSure();
} catch (\\Throwable $exception) {
\\Sentry\\captureException($exception);
}`;
const onboarding: OnboardingConfig = {
install: params => [
{
type: StepType.INSTALL,
description: tct(
'To install the PHP SDK, you need to be using Composer in your project. For more details about Composer, see the [composerDocumentationLink:Composer documentation].',
{
composerDocumentationLink:
{tct(
'To instrument certain regions of your code, you can [instrumentationLink:create transactions to capture them].',
{
instrumentationLink: (
,
}
)}
}
),
language: 'php',
code: `
\\Sentry\\init([
'dsn' => '${params.dsn.public}',
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
'traces_sample_rate' => 1.0,
]);
`,
additionalInfo: tct(
'We recommend adjusting the value of [code:tracesSampleRate] in production. Learn more about tracing [linkTracingOptions:options], how to use the [linkTracesSampler:traces_sampler] function, or how to do [linkSampleTransactions:sampling].',
{
code:
,
linkTracingOptions: (