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

Issue with Handling Incoming traceparent Header (NEXT_OTEL_VERBOSE=1) #107

Open
rudebono opened this issue Jul 21, 2024 · 0 comments
Open

Comments

@rudebono
Copy link

rudebono commented Jul 21, 2024

Hello, I have a question regarding the use of vercel/otel.

After setting the traceparent header in the browser and sending a request to Next.js,
I expect multiple spans to be created based on the same trace ID.
However, this is not happening as expected. Instead of using the trace ID from the traceparent header I set, a new trace ID generated by Next.js is being used.

Is there any additional configuration required to create spans based on the traceparent header sent from the browser?
Or is this functionality not supported by vercel/otel?

I am using the following:

node: v18.20.3

  • "@vercel/otel": "^1.9.1"
  • "next": "14.2.5"

next.config.mjs

const nextConfig = {
    experimental: {
        instrumentationHook: true
    }
};

export default nextConfig;

instrumentation.ts

import { registerOTel } from '@vercel/otel'
 
export function register() {
  registerOTel({ serviceName: 'next-app' })
}

.env.development

NEXT_OTEL_VERBOSE = 1
OTEL_EXPORTER_OTLP_ENDPOINT = https://<CUSTOM_DOMAIN>

Header

{ "traceparent": "00-6d2eac29c9283ece795b4fbaa2d57225-bad4e819c34d2cdb-01" }
스크린샷 2024-07-22 오전 12 38 07

Result
All requests were successfully created with random Trace IDs.
However, the Trace IDs were not the ones from the traceparent header as I expected.

스크린샷 2024-07-22 오전 12 50 20 스크린샷 2024-07-22 오전 12 39 51
@rudebono rudebono changed the title Issue with Handling Incoming traceparent Header Issue with Handling Incoming traceparent Header (NEXT_OTEL_VERBOSE=1) Jul 24, 2024
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

1 participant