-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tm-tav-fix-no-legacy-peer-deps
- Loading branch information
Showing
10 changed files
with
327 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
"fastify": | ||
- versions: "4.23.2" | ||
# Sanity check the first 4.x release, instead of all releases, plus recent | ||
# releases. | ||
- versions: "4.0.0 || >=4.24.3 <5" | ||
commands: npm run test | ||
|
||
# Fastify versions after 4.18.0 require a typescript greater than 4.4.4. | ||
"typescript": | ||
- versions: "4.7.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,8 +96,9 @@ export class FastifyInstrumentation extends InstrumentationBase { | |
const anyRequest = request as any; | ||
|
||
const rpcMetadata = getRPCMetadata(context.active()); | ||
const routeName = | ||
anyRequest.routeOptions?.config?.url || request.routerPath; | ||
const routeName = anyRequest.routeOptions | ||
? anyRequest.routeOptions.url // since [email protected] | ||
: request.routerPath; | ||
if (routeName && rpcMetadata?.type === RPCType.HTTP) { | ||
rpcMetadata.route = routeName; | ||
} | ||
|
@@ -265,18 +266,21 @@ export class FastifyInstrumentation extends InstrumentationBase { | |
const anyRequest = request as any; | ||
|
||
const handler = | ||
anyRequest.routeOptions?.handler || anyRequest.context?.handler || {}; | ||
anyRequest.routeOptions?.handler || anyRequest.context?.handler; | ||
|
||
const handlerName = handler?.name.substr(6); | ||
const handlerName = handler?.name.startsWith('bound ') | ||
? handler.name.substr(6) | ||
: handler?.name; | ||
const spanName = `${FastifyNames.REQUEST_HANDLER} - ${ | ||
handlerName || this.pluginName || ANONYMOUS_NAME | ||
}`; | ||
|
||
const spanAttributes: SpanAttributes = { | ||
[AttributeNames.PLUGIN_NAME]: this.pluginName, | ||
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER, | ||
[SemanticAttributes.HTTP_ROUTE]: | ||
anyRequest.routeOptions?.config?.url || request.routerPath, | ||
[SemanticAttributes.HTTP_ROUTE]: anyRequest.routeOptions | ||
? anyRequest.routeOptions.url // since [email protected] | ||
: request.routerPath, | ||
}; | ||
if (handlerName) { | ||
spanAttributes[AttributeNames.FASTIFY_NAME] = handlerName; | ||
|
Oops, something went wrong.