opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

[instrumentation] hide `shimmer` types from the public API

Open pichlermarc opened this issue 1 year ago • 0 comments
trafficstars

Description:

@types/shimmer is currently part of the @opentelemetry/instrumentation package's public API. We should avoid having a third-party dependency be part of the public API of this package as breaking changes will affect the public interface of @opentelemetry/instrumentation

A solution to this can be changing InstrumentationAbstract#_wrap, InstrumentationAbstract#_unwrap, InstrumentationAbstract#massUnwrap, InstrumentationAbstract#massWrap to be custom functions that wrap shimmer functions and for which we fully control the types.

This issue is considered done when:

  • [ ] shimmer, `@types/shimmer exports are hidden in a way so that they are not part of the public API anymore
  • [ ] @types/shimmer is moved to devDependenices or removed completely

Additional Details

Code sections of interest:

  • https://github.com/open-telemetry/opentelemetry-js/blob/01a2c35a694e57df45f063d61506ef9e9938eb7d/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts#L73-L80
  • https://github.com/open-telemetry/opentelemetry-js/blob/01a2c35a694e57df45f063d61506ef9e9938eb7d/experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts#L82-L152

This issue is part of #4586

pichlermarc avatar Jul 01 '24 14:07 pichlermarc