Boto3

Learn about the Boto3 integration and how it adds support for the Boto3 and botocore libraries.

The Boto3 integration instruments requests made to Amazon Web Services done with Boto3 (or the low level botocore library that Boto3 uses under the hood). It creates a span for every request.

Install sentry-sdk from PyPI:

Copied
pip install --upgrade 'sentry-sdk'

If you have the boto3 package in your dependencies, the Boto3 integration will be enabled automatically when you initialize the Sentry SDK.

Copied
import sentry_sdk

sentry_sdk.init(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    # Add data like request headers and IP for users, if applicable;
    # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
    send_default_pii=True,
    #  performance
    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for tracing.
    traces_sample_rate=1.0,
    #  performance
    #  profiling
    # To collect profiles for all profile sessions,
    # set `profile_session_sample_rate` to 1.0.
    profile_session_sample_rate=1.0,
    # Profiles will be automatically collected while
    # there is an active span.
    profile_lifecycle="trace",
    #  profiling
)

  • botocore: 1.12+
  • Python: 3.6+
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").