Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pip-wheel-metadata
.mypy_cache
.vscode/
.claude/
.tool-versions

# for running AWS Lambda tests using AWS SAM
sam.template.yaml
1 change: 1 addition & 0 deletions sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ def _capture_envelope(envelope):
"auto_enabling_integrations"
],
disabled_integrations=self.options["disabled_integrations"],
options=self.options,
)

spotlight_config = self.options.get("spotlight")
Expand Down
20 changes: 15 additions & 5 deletions sentry_sdk/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Set
from typing import Type
from typing import Union
from typing import Any


_DEFAULT_FAILED_REQUEST_STATUS_CODES = frozenset(range(500, 600))
Expand Down Expand Up @@ -171,12 +172,13 @@ def iter_default_integrations(with_auto_enabling_integrations):


def setup_integrations(
integrations,
with_defaults=True,
with_auto_enabling_integrations=False,
disabled_integrations=None,
integrations, # type: Sequence[Integration]
with_defaults=True, # type: bool
with_auto_enabling_integrations=False, # type: bool
disabled_integrations=None, # type: Optional[Sequence[Union[type[Integration], Integration]]]
options=None, # type: Optional[Dict[str, Any]]
):
# type: (Sequence[Integration], bool, bool, Optional[Sequence[Union[type[Integration], Integration]]]) -> Dict[str, Integration]
# type: (...) -> Dict[str, Integration]
"""
Given a list of integration instances, this installs them all.

Expand Down Expand Up @@ -221,6 +223,7 @@ def setup_integrations(
)
try:
type(integration).setup_once()
integration.setup_once_with_options(options)
except DidNotEnable as e:
if identifier not in used_as_default_integration:
raise
Expand Down Expand Up @@ -300,3 +303,10 @@ def setup_once():
instance again.
"""
pass

def setup_once_with_options(self, options=None):
# type: (Optional[Dict[str, Any]]) -> None
"""
Called after setup_once in rare cases on the instance and with options since we don't have those available above.
"""
pass