Apache Beam

Learn about using Sentry with Beam.

The Beam integration currently parses the functions in ParDo to return exceptions in their respective setup, start_bundle, process, and finish_bundle functions.

This integration is experimental. It may be removed in minor versions. When enabling this integration, expect to see incorrect server_name and ip due to some distributed properties within Beam.

A Beam version of 2.12 or later is required.

Add BeamIntegration() to your integrations list:

In addition to capturing errors, you can monitor interactions between multiple services or applications by enabling tracing. You can also collect and analyze performance profiles from real users with profiling.

Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.

Copied
import sentry_sdk
from sentry_sdk.integrations.beam import BeamIntegration

sentry_sdk.init(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for tracing.
    traces_sample_rate=1.0,
    # Set profiles_sample_rate to 1.0 to profile 100%
    # of sampled transactions.
    # We recommend adjusting this value in production.
    profiles_sample_rate=1.0,
    integrations=[
        BeamIntegration(),
    ],
)

  • The functions get injected with an inspect function to patch getting the function signature.
  • The integration requires Sentry to be installed on all the worker computers using a --requirements_file.
  • The main computer invoking the pipeline requires the same version of Sentry as the worker nodes.
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").