-
Notifications
You must be signed in to change notification settings - Fork 544
Manual transaction handling not instrumenting spans correctly #4096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is how I fixed it: import sentry_sdk
sentry_sdk.init(dsn=DSN, debug=True, traces_sample_rate=1)
@sentry_sdk.trace
def test():
return 1 + 1
with sentry_sdk.start_transaction(
name="replays.consumer.process_recording", op="replays.consumer"
):
test() The context manager works but transaction start() and finish() do not. |
Not sure if this is an SDK bug or just a misunderstanding on my part. Is |
Yes, |
So the two options are either to use the context manager ( |
@antonpirker @sentrivana What's interesting is that this was working previously. See my PR: https://github.com/getsentry/sentry/pull/85447/files#diff-c9170e96111ac9ba2c4657aaeef8281aad6254fb7bcbacec272b2a2c8eca0355L106-L114 |
Ah never mind I call with |
As this is resolved, I am closing this issue. |
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.22.0
Steps to Reproduce
Expected Result
A trace that looks like this:
https://sentry-sdks.sentry.io/discover/trace/1b95c2cc910b434ea3f98a4b957c7c87/?dataset=transactions&field=title&field=project&field=user.display&field=timestamp&name=All%20Errors&node=txn-6ab2c26430f746fc860e615275f8ae49&project=4508876404162560&query=&queryDataset=transaction-like&sort=-timestamp&source=discover&statsPeriod=5m×tamp=1740434501&yAxis=count%28%29
Actual Result
A trace that looks like this:
https://sentry-sdks.sentry.io/discover/trace/412b2b91a64047a8884b6b46cf1585ca/?dataset=transactions&field=title&field=project&field=user.display&field=timestamp&name=All%20Errors&node=txn-6c3772f93adf4e96900f5f5aa9fff341&project=4508876404162560&query=&queryDataset=transaction-like&sort=-timestamp&source=discover&statsPeriod=5m×tamp=1740434513&yAxis=count%28%29
The text was updated successfully, but these errors were encountered: