feat: add rootSpanNameOverride option#826
Conversation
|
Why are we still supporting the header for an override? |
|
@ofrobots Whoops, removed. |
| * will be invoked with the request path as an argument, and its return value | ||
| * will be used as the span name. | ||
| */ | ||
| incomingRequestSpanNameOverride?: string|((path: string) => string); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| }); | ||
| }); | ||
|
|
||
| it('uses the span name override header when assoc. option is on', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| .incomingRequestSpanNameOverride; | ||
| testTraceModule.get().getConfig().incomingRequestSpanNameOverride = | ||
| (path: string) => `${path}-goodbye`; | ||
| const spanNameOverrideKey = |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@ofrobots I changed it so that root spans are affected, not HTTP incoming requests. The code is now in the |
| const spanName = config.rootSpanNameOverride; | ||
| config.rootSpanNameOverride = () => spanName; | ||
| } else if (typeof config.rootSpanNameOverride !== 'function') { | ||
| config.rootSpanNameOverride = (name: string) => name; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
| }); | ||
|
|
||
| it('should convert a non-string, non-function to the default arg', () => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This PR introduces
rootSpanNameOverride, which allows us to override span names differently than in #821.