Skip to content

Commit

Permalink
hopefully helpful comment on when routeOptions.url became available
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Nov 6, 2023
1 parent bd91541 commit 03a26ac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class FastifyInstrumentation extends InstrumentationBase {

const rpcMetadata = getRPCMetadata(context.active());
const routeName = anyRequest.routeOptions
? anyRequest.routeOptions.url
? anyRequest.routeOptions.url // since [email protected]
: request.routerPath;

Check warning on line 101 in plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts

View check run for this annotation

Codecov / codecov/patch

plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L101

Added line #L101 was not covered by tests
if (routeName && rpcMetadata?.type === RPCType.HTTP) {
rpcMetadata.route = routeName;
Expand Down Expand Up @@ -279,7 +279,7 @@ export class FastifyInstrumentation extends InstrumentationBase {
[AttributeNames.PLUGIN_NAME]: this.pluginName,
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER,
[SemanticAttributes.HTTP_ROUTE]: anyRequest.routeOptions
? anyRequest.routeOptions.url
? anyRequest.routeOptions.url // since [email protected]
: request.routerPath,

Check warning on line 283 in plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts

View check run for this annotation

Codecov / codecov/patch

plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L283

Added line #L283 was not covered by tests
};
if (handlerName) {
Expand Down

0 comments on commit 03a26ac

Please sign in to comment.