Modules

Integration for attaching loaded libraries and their versions to events, populating the event modules field.

Statusstable
Version1.0.0(changelog)

The Modules integration attaches a list of loaded libraries (packages, modules) and their versions to events. This populates the modules field on the event payload, which Sentry displays in the event detail view to help users identify dependency-related issues.

This integration SHOULD be a default integration.


Stablespecified since 1.0.0

The integration MUST use the processEvent lifecycle hook to attach module information to events.

The integration MUST populate event.modules as a map of module name to version string:

Copied
{  "modules": {  "flask": "2.3.1",  "requests": "2.31.0",  "sqlalchemy": "2.0.19"  } } 

The integration SHOULD cache the module list, since installed packages rarely change during a process lifetime.

Stablespecified since 1.0.0

How modules are discovered is platform-specific. SDKs SHOULD use the most reliable mechanism available on their platform. Common strategies include:

  • Package manager metadata — reading installed package registries (e.g., pkg_resources or importlib.metadata in Python, package.json dependencies in Node.js)
  • Runtime module cache — inspecting loaded modules from the runtime (e.g., require.cache in Node.js CJS)
  • Build-time injection — embedding module information at build time when runtime discovery is unavailable or incomplete (e.g., bundled environments)

SDKs MAY combine multiple sources to produce the most complete list. When the same module appears in multiple sources, the more specific version (e.g., from a lockfile or runtime cache) SHOULD take precedence.

Stablespecified since 1.0.0

SDKs MAY skip attaching modules to certain event types (e.g., transactions) where the information is less useful, to reduce payload size.


Copied
// modulesIntegration is a default integration in @sentry/node Sentry.init({  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0", });  // Modules are automatically attached to error events. // The integration reads from package.json and require.cache (CJS). 

Copied
import sentry_sdk  # ModulesIntegration is a default integration sentry_sdk.init(dsn="https://examplePublicKey@o0.ingest.sentry.io/0")  # Modules are automatically attached to error events. # The integration reads from importlib.metadata / pkg_resources. 

VersionDateSummary
1.0.02026-03-04Initial spec, extracted from expected features
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").