Skip to content

Commit afc488d

Browse files
authored
fix(tracing) : Add trace to __all__ in top-level __init__.py (#2401)
Currently, using the decorator form of `trace` like this (as mentioned in the docs[1]): ``` import sentry_sdk @sentry_sdk.trace def do_stuff(): ``` causes mypy to throw a `Module "sentry_sdk" does not explicitly export attribute "trace" [attr-defined]` error. This adds `trace` to the top-level `__init__.py`'s `__all__` so mypy sees it as being officially exported and stops throwing the error. [1] https://docs.sentry.io/platforms/python/performance/instrumentation/custom-instrumentation/#using-a-decorator-1
1 parent 7c74ed3 commit afc488d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sentry_sdk/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"get_traceparent",
4040
"get_baggage",
4141
"continue_trace",
42+
"trace",
4243
]
4344

4445
# Initialize the debug support after everything is loaded

0 commit comments

Comments
 (0)