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

Duplicate request traces for a single request #124

Open
cbodin opened this issue Sep 18, 2024 · 1 comment
Open

Duplicate request traces for a single request #124

cbodin opened this issue Sep 18, 2024 · 1 comment

Comments

@cbodin
Copy link

cbodin commented Sep 18, 2024

Each request to the Next.js application will send 2 traces. This seems to be related to the internal request routing as the operation.name differs and the first trace shows the actual path and the second trace shows the matched route.

E.g. in ApplicationInsights:
image

For example, a catch-all page that triggers a notFound() will show the first trace as successful and the second (correctly) as unsuccessful.

Request properties:

Attribute Trace 1 value Trace 2 value
Event time 9/18/2024, 2:40:09.999 PM (Local time) 9/18/2024, 2:40:10.117 PM (Local time)
Name GET /this-page-does-not-exist GET /[locale]/[[...slug]]
Response code 200 404
Successful request true false
Response time 61.3 ms 1.4 s

Custom properties:

Attribute Trace 1 value Trace 2 value
next.span_name GET /this-page-does-not-exist GET /[locale]/[[...slug]]
next.span_type BaseServer.handleRequest BaseServer.handleRequest
http.target /this-page-does-not-exist /this-page-does-not-exist
next.rsc false false
next.route N/A /[locale]/[[...slug]]
next.bubble true N/A
operation.name next_js.BaseServer.handleRequest web.request
resource.name N/A GET /[locale]/[[...slug]]

Package Version
next 14.2.3
@vercel/otel 1.10.0
@opentelemetry/api 1.9.0
@azure/monitor-opentelemetry-exporter 1.0.0-beta.26
@k-koleda
Copy link

same for me. this thing is creating lots of noise in my case in Grafana Tempo

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

No branches or pull requests

2 participants