Skip to content

Allow loading @opentelemetry/winston-transport dynamically #2558

Open
@harelmo-lumigo

Description

@harelmo-lumigo

Is your feature request related to a problem? Please describe

Winston instrumentation assumes @opentelemetry/winston-transport is installed and attempts to resolve it using require, from a location adjacent to the application using Winston.
That limits the use-cases for packages wrapping the @opentelemetry/winston-instrumentation, as the transport cannot be provided via a different path or by some other dynamic loading method.

Describe the solution you'd like to see

Provide a constructor argument that will allow specifying the transport to be used, as an instance of OpenTelemetryTransportV3.

Describe alternatives you've considered

Alternatively, there can be either:

  1. an env-var respected by the instrumentation that points to the path from which the transport can be loaded
  2. a constructor argument with the path to load the transport from, instead of providing an instance
  3. a constructor argument with a function through which a transport instance can be obtained

Additional context

None

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