Skip to content

Provide bundler/esbuild support and documentation #921

Open
@davemyers-dev

Description

@davemyers-dev

Feature Enhancement Request

The current library is incredibly difficult to use in a modern Node project that utilizes esbuild for bundling. There is a brief section in the Splunk docs that mentions excluding express from bundling, but it is not sufficient for this library to work when using a bundler.

Several development practices in the library cause runtime errors when combined with esbuild including:

  1. Using relative path imports/requires
  2. Dynamically loading packages
    const Instrumentation = load(desc.module, desc.name);
  3. Providing native binaries

Datadog provides an esbuild plugin to properly utilize their their OTEL trace wrapper library seen here:
https://github.com/DataDog/dd-trace-js/blob/master/packages/datadog-esbuild/index.js
https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/dd_libraries/nodejs/#bundling

I would prefer to utilize the Splunk APM specific implementations of AlwaysOn Profiling and Runtime metrics, however, the lack of support, documentation, and community adoption makes this challenging. These challenges are not present when utilizing the OTEL-js libraries or auto-instrumentation directly.

Request:
To provide one the following:

  • A similar esbuild plugin that can be utilized with this library
  • First-class documentation that details the workarounds necessary to use this library with a bundler such as esbuild
  • Modules/Examples that can be utilized to feed appropriate profiler and metric data to splunk when using the OTEL libraries directly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions