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
2 changes: 1 addition & 1 deletion lite_bootstrap/instruments/logging_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def structlog_pre_chain_processors(self) -> list[typing.Any]:
]

def is_ready(self) -> bool:
return self.bootstrap_config.logging_enabled and import_checker.is_structlog_installed
return self.bootstrap_config.logging_enabled

@staticmethod
def check_dependencies() -> bool:
Expand Down
5 changes: 1 addition & 4 deletions lite_bootstrap/instruments/opentelemetry_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ class OpenTelemetryInstrument(BaseInstrument):
)

def is_ready(self) -> bool:
return (
bool(self.bootstrap_config.opentelemetry_endpoint or self.bootstrap_config.opentelemetry_log_traces)
and import_checker.is_opentelemetry_installed
)
return bool(self.bootstrap_config.opentelemetry_endpoint or self.bootstrap_config.opentelemetry_log_traces)

@staticmethod
def check_dependencies() -> bool:
Expand Down
2 changes: 1 addition & 1 deletion lite_bootstrap/instruments/pyroscope_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PyroscopeInstrument(BaseInstrument):
missing_dependency_message = "pyroscope is not installed"

def is_ready(self) -> bool:
return bool(self.bootstrap_config.pyroscope_endpoint) and import_checker.is_pyroscope_installed
return bool(self.bootstrap_config.pyroscope_endpoint)

@staticmethod
def check_dependencies() -> bool:
Expand Down
4 changes: 2 additions & 2 deletions lite_bootstrap/instruments/sentry_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


IGNORED_STRUCTLOG_ATTRIBUTES: typing.Final = frozenset(
{"event", "level", "logger", "tracing", "timestamp", "exception"}
{"event", "level", "logger", "tracing", "timestamp", "exception", "skip_sentry"}
)


Expand Down Expand Up @@ -98,7 +98,7 @@ class SentryInstrument(BaseInstrument):
missing_dependency_message = "sentry_sdk is not installed"

def is_ready(self) -> bool:
return bool(self.bootstrap_config.sentry_dsn) and import_checker.is_sentry_installed
return bool(self.bootstrap_config.sentry_dsn)

@staticmethod
def check_dependencies() -> bool:
Expand Down
10 changes: 10 additions & 0 deletions tests/instruments/test_sentry_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def test_skip(self, event: "sentry_types.Event") -> None:
"contexts": {"structlog": {"foo": "bar"}},
},
),
(
{
"logentry": {"formatted": '{"event": "event name", "skip_sentry": false, "foo": "bar"}'},
"contexts": {},
},
{
"logentry": {"formatted": "event name"},
"contexts": {"structlog": {"foo": "bar"}},
},
),
],
)
def test_modify(self, event_before: "sentry_types.Event", event_after: "sentry_types.Event") -> None:
Expand Down
Loading