Skip to content

[Tracking Issue] Improve Bun Support #19707

@s1gr1d

Description

@s1gr1d

The Bun runtime is getting used more and more and the JavaScript SDKs should support this ongoing trend. This issue is a tracking issue that shows current missing features with the Bun runtime.

Missing auto-instrumentation (because module.register is not supported in Bun)

In general, a lot of missing auto-instrumentation is based on the missing support for module.register in Bun (Bun docs). Auto-instrumentation of ES Modules in OpenTelemetry is based on import-in-the-middle which calls module.register.

A real fix would require either (a) Bun improving module.register() + ESM namespace mutability support, or (b) the SDK implementing a Bun-specific loader (e.g., using Bun's native plugin API) to intercept imports before they are bound.

Missing HTTP spans

The HTTP spans are created based on what diagnostic channels publish. Bun supports diagnostics channels but does not yet publish the necessary notifications. There is an open PR for that in Bun: oven-sh/bun#24375

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions