12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import ExternalLink from 'sentry/components/links/externalLink';
- import {Layout, LayoutProps} from 'sentry/components/onboarding/gettingStartedDoc/layout';
- import {ModuleProps} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation';
- import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
- import {t, tct} from 'sentry/locale';
- // Configuration Start
- const introduction = (
- <p>
- {tct(
- "The Bottle integration adds support for the Bottle Web Framework. Currently it works well with the stable version of Bottle (0.12). However the integration with the development version (0.13) doesn't work properly.",
- {
- link: <ExternalLink href="https://bottlepy.org/docs/dev/" />,
- }
- )}
- </p>
- );
- export const steps = ({
- dsn,
- }: Partial<Pick<ModuleProps, 'dsn'>> = {}): LayoutProps['steps'] => [
- {
- type: StepType.INSTALL,
- description: (
- <p>
- {tct(
- 'Install [sentrySdkCode:sentry-sdk] from PyPI with the [sentryBotteCode:bottle] extra:',
- {
- sentrySdkCode: <code />,
- sentryBotteCode: <code />,
- }
- )}
- </p>
- ),
- configurations: [
- {
- language: 'bash',
- code: 'pip install --upgrade sentry-sdk[chalice]',
- },
- ],
- },
- {
- type: StepType.CONFIGURE,
- description: t(
- 'To configure the SDK, initialize it with the integration before your app has been initialized:'
- ),
- configurations: [
- {
- language: 'python',
- code: `
- import sentry_sdk
- from bottle import Bottle, run
- from sentry_sdk.integrations.bottle import BottleIntegration
- sentry_sdk.init(
- dsn="${dsn}",
- integrations=[
- BottleIntegration(),
- ],
- # Set traces_sample_rate to 1.0 to capture 100%
- # of transactions for performance monitoring.
- # We recommend adjusting this value in production,
- traces_sample_rate=1.0,
- )
- app = Bottle()
- `,
- },
- ],
- },
- ];
- // Configuration End
- export function GettingStartedWithBottle({dsn, ...props}: ModuleProps) {
- return <Layout steps={steps({dsn})} introduction={introduction} {...props} />;
- }
- export default GettingStartedWithBottle;
|