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

Attributes set using attributesFromHeaders not showing up on trace #121

Open
cbodin opened this issue Sep 16, 2024 · 0 comments
Open

Attributes set using attributesFromHeaders not showing up on trace #121

cbodin opened this issue Sep 16, 2024 · 0 comments

Comments

@cbodin
Copy link

cbodin commented Sep 16, 2024

The attributesFromHeaders option does not seem to be working correctly, or it needs some more documentation for how to configure it.

I've configured everything according to the Using @vercel/otel page, and configured the OpenTelemetry dev environment.

My instrumentation.ts file:

export async function register() {
  registerOTel({
    serviceName: "sample-service-name",
    attributes: {
      "app.environment": process.env.NEXT_PUBLIC_ENVIRONMENT,
      "app.test": "hello",
    },
    attributesFromHeaders: {
      "app.referer": "referer",
      "app.host": "host",
      "app.accept": "accept",
      "app.method": "method",
      "http.referer": "referer",
      "http.host": "host",
      "http.accept": "accept",
      "http.method": "method",
    },
  });
}

Looking at the collected trace in Zipkin, all the header attributes are missing:

Tag Value
app.environment local
app.test hello
http.method GET
http.route /[locale]/[[...slug]]
http.status_code 200
http.target /sample-page
next.route /[locale]/[[...slug]]
next.rsc false
next.span_name GET /[locale]/[[...slug]]
next.span_type BaseServer.handleRequest
node.env development
operation.name web.request
otel.library.name next.js
otel.library.version 0.0.1
resource.name GET /[locale]/[[...slug]]
telemetry.sdk.language nodejs
telemetry.sdk.name opentelemetry
telemetry.sdk.version 1.19.0
vercel.runtime nodejs

Package Version
next 14.2.3
@vercel/otel 1.10.0
@opentelemetry/api 1.9.0

Possible duplicate of #109

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