Skip to content

Conversation

lemusthelroy
Copy link

@lemusthelroy lemusthelroy commented Oct 15, 2025

This allows us to manually pass headers that we wish to propagate. E.g. headers from a Netlify Request in a serverless function. These headers can then be used in the fetch instrumentation to ensure we can forward on the trace context.

E.g.

const fetchInst = new FetchInstrumentation()

await createTracerProvider({
    // ...props
    propagationHeaders: netlifyRequest.Headers,
    instrumentations: [
      fetchInst
    ],
  })

},
})

Object.defineProperty(globalThis, GET_TRACE_CONTEXT_FORWARDER, {
Copy link
Author

Choose a reason for hiding this comment

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

not totally convinced this is the best way to make this forwarder accessible to the fetch instrumentation so may rework this

@lemusthelroy lemusthelroy marked this pull request as ready for review October 16, 2025 09:23
@lemusthelroy lemusthelroy requested a review from a team as a code owner October 16, 2025 09:23
@lemusthelroy lemusthelroy marked this pull request as draft October 16, 2025 09:24
@lemusthelroy lemusthelroy marked this pull request as ready for review October 16, 2025 09:29
@eduardoboucas
Copy link
Member

@lemusthelroy Can you add a brief description that describes what problem this tries to solve and how it's meant to be used, so that it's easier to review?

@lemusthelroy
Copy link
Author

@lemusthelroy Can you add a brief description that describes what problem this tries to solve and how it's meant to be used, so that it's easier to review?

Will do, sorry had been so focused on the code

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.

2 participants