Skip to content

Commit ae9cdb0

Browse files
authored
feat(profiling): Allow profiling sample rate to be passed from env (#24)
* feat(profiling): Allow profiling sample rate to be passed from env This sets a default profiling sample rate of 0 since not everyone may want profiling in CI due to cost concerns, but allows it to be enabled by passing it from the environment. * Should be a float
1 parent aedb216 commit ae9cdb0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pytest_sentry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def __init__(self, *args, **kwargs):
8686
"traces_sample_rate",
8787
float(os.environ.get("PYTEST_SENTRY_TRACES_SAMPLE_RATE", 1.0)),
8888
)
89+
kwargs.setdefault("profiles_sample_rate", float(os.environ.get("PYTEST_SENTRY_PROFILES_SAMPLE_RATE", 0.0)))
8990
kwargs.setdefault("_experiments", {}).setdefault(
9091
"auto_enabling_integrations", True
9192
)

0 commit comments

Comments
 (0)