Skip to content
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

fix: OTel spans for Sentry requests #3001

Merged
merged 5 commits into from
Jan 5, 2024
Merged

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Jan 3, 2024

Fixes #2998

Looks like the key changed.

@@ -113,7 +113,7 @@ public override void OnEnd(Activity data)
// Make a dictionary of the attributes (aka "tags") for faster lookup when used throughout the processor.
var attributes = data.TagObjects.ToDict();

if (attributes.TryGetTypedValue("http.url", out string? url) && (_options?.IsSentryRequest(url) ?? false))
if (attributes.TryGetTypedValue("url.full", out string? url) && (_options?.IsSentryRequest(url) ?? false))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this approach to detect if it's a Sentry request seems rather fragile

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other ideas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsyncLocal?

Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, should have put this in the original review... might be good to change this test from a Fact to a Theory and test it with both the old and the new:

[Fact]
public void OnEnd_IsSentryRequest_DoesNotFinishTransaction()

At the moment, it only tests the old attributes.

@bitsandfoxes bitsandfoxes merged commit a451d1f into main Jan 5, 2024
19 checks passed
@bitsandfoxes bitsandfoxes deleted the fix/otel-sentry-spans branch January 5, 2024 15:09
@bitsandfoxes bitsandfoxes restored the fix/otel-sentry-spans branch January 10, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTelemetry causes sentry transactions loop
3 participants