Skip to content

[next] Use diagnostics_channel for http instrumentations #4319

@dyladan

Description

@dyladan

Now that we've removed support for old runtimes, we can use the new diagnostics channels to instrument node core http libraries.

Known issues

http.client.request.start - event.request is not writeable

Because the event is emitted after the request is already in flight, we cannot modify the headers. This means we cannot add the required tracing headers for context propagation. We will still need to rely on patching the http and https modules for at least this purpose unless the http channel implementations change.

If nodejs adds something similar to undici's undici:request:create, this issue may be solved and we may be able to remove all manual monkeypatching from the instrumentation. In this case, we may even be able to remove {require|import}-in-the-middle.

Context Management

See #4319 (comment) below

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions