-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add rootSpanNameOverride option #826
Conversation
Why are we still supporting the header for an override? |
@ofrobots Whoops, removed. |
src/config.ts
Outdated
* 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.
test/test-trace-web-frameworks.ts
Outdated
@@ -334,6 +336,29 @@ describe('Web framework tracing', () => { | |||
`span name ${serverSpan.name} includes query parameters`); | |||
}); | |||
}); | |||
|
|||
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.
test/test-trace-web-frameworks.ts
Outdated
.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.
test/test-config.ts
Outdated
} | ||
}); | ||
|
||
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.