-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(nextjs): Remove Http integration from Next.js #11304
Conversation
c10f4ed
to
2184334
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
return new Proxy(routeHandler, { | ||
apply: (originalFunction, thisArg, args) => { | ||
return withIsolationScope(async isolationScope => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h: Since the http integration was responsible for creating the isolation scope, we need to add the call to withIsolationScope
back, otherwise we'll mutate the global isolation scope and leak request data into other requests.
a9e26e9
to
b3bc50f
Compare
size-limit report 📦
|
d41b917
to
37649af
Compare
const spanJson = spanToJSON(span); | ||
|
||
// The following check is a heuristic to determine whether the started span is a span that tracks an incoming HTTP request | ||
if (getSpanKind(span) === SpanKind.SERVER && spanJson.data && 'http.method' in spanJson.data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m: Let's use otel semantic attributes here (from @opentelemetry/semantic-conventions
), I'd say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense! Here: #11467
This comment was supposed to be elsewhere, I added it to the correct place
@@ -72,6 +73,16 @@ export class SentrySampler implements Sampler { | |||
[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, | |||
}; | |||
|
|||
const method = `${spanAttributes[SemanticAttributes.HTTP_METHOD]}`.toUpperCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pull this into a separate PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense! Here: #11467
37649af
to
786b4cb
Compare
364119c
to
6f17db7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice! Such a small and easy PR at the end xD
rootSpan.updateName(spanName); | ||
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route'); | ||
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.server'); | ||
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.function.nextjs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: In a follow up, we can extend this to also set method and other stuff we possibly get there. But no need to do that now!
Side note, you can also use rootSpan.setAttributes({ ... })
to set multiple attributes at once :)
This reverts commit fda5f32.
Just trying some things...
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
6bc00da
to
1674e11
Compare
Next.js provides their own OTel http integration, which conflicts with ours ref getsentry#11016 added commit from this PR: getsentry#11319 --------- Co-authored-by: Luca Forstner <luca.forstner@sentry.io> Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
Next.js provides their own OTel http integration, which conflicts with ours
ref #11016
added commit from this PR: #11319