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 = (

{tct( 'The PyMongo integration adds support for [link:PyMongo], the official MongoDB driver. It adds breadcrumbs and performace traces for all queries.', { link: , } )}

); export const steps = ({ dsn, }: Partial> = {}): LayoutProps['steps'] => [ { type: StepType.INSTALL, description: (

{tct( 'Install [sentrySdkCode:sentry-sdk] from PyPI with the [pymongoCode:pymongo] extra:', { sentrySdkCode: , pymongoCode: , } )}

), configurations: [ { language: 'bash', code: `pip install --upgrade 'sentry-sdk[pymongo]'`, }, ], }, { type: StepType.CONFIGURE, description: t( "To configure the SDK, initialize it before creating any of PyMongo's MongoClient instances:" ), configurations: [ { language: 'python', code: ` import sentry_sdk from sentry_sdk.integrations.pymongo import PyMongoIntegration sentry_sdk.init( dsn="${dsn}", integrations=[ PyMongoIntegration(), ], # 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, ) `, }, ], additionalInfo: (

{tct( 'The above configuration captures both breadcrumbs and performance data. To reduce the volume of performance data captured, change [code:traces_sample_rate] to a value between 0 and 1.', {code: } )}

), }, ]; // Configuration End export function GettingStartedWithMongo({dsn, ...props}: ModuleProps) { return ; } export default GettingStartedWithMongo;