pragmaticivan / nestjs-otel

OpenTelemetry (Tracing + Metrics) module for Nest framework (node.js) 🔭
Apache License 2.0
562 stars 48 forks source link

fix: `Span` being incompatible with `MethodDecorator` type #465

Closed mertalev closed 9 months ago

mertalev commented 9 months ago

The decorator returned by Span specifies the propertyKey field as string, while the TypeScript MethodDecorator type requires it to allow symbol as well.

This is relevant as it can cause type conflicts when used with functions that expect a MethodDecorator. An example of this is the decorate-all package used to apply a decorator to all methods of a class.

This PR updates the typing and adds a unit test for symbols.

pragmaticivan commented 9 months ago

Thanks!