Skip to content

Commit

Permalink
fix(issue-86): Use new fastify config
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
  • Loading branch information
rozzilla authored and SkeLLLa committed Sep 20, 2023
1 parent b4ef6b2 commit de6a03c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fastify-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ export class FastifyMetrics implements IFastifyMetrics {
private collectRouteMetrics(): void {
this.deps.fastify
.addHook('onRequest', (request, _, done) => {
if (request.routeConfig.disableMetrics === true || !request.raw.url) {
if (
request.routeOptions.config.disableMetrics === true ||
!request.raw.url
) {
return done();
}

Expand All @@ -314,7 +317,7 @@ export class FastifyMetrics implements IFastifyMetrics {
this.routesWhitelist.has(
FastifyMetrics.getRouteSlug({
method: request.method,
url: request.routerPath,
url: request.routeOptions.url,
})
)
) {
Expand Down

0 comments on commit de6a03c

Please sign in to comment.