File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,10 @@ import {
1111 RawRequestDefaultExpression ,
1212 RawServerDefault ,
1313} from "fastify" ;
14- import { createRequire } from "module " ;
14+ import fastifyMetrics from "fastify-metrics " ;
1515import * as path from "path" ;
1616import { fileURLToPath } from "url" ;
1717
18- const require = createRequire ( import . meta. url ) ;
19- const fastifyMetrics = require ( "fastify-metrics" ) ;
20-
2118const __filename = fileURLToPath ( import . meta. url ) ;
2219const __dirname = path . dirname ( __filename ) ;
2320
@@ -74,7 +71,7 @@ if (options.lokiHost) {
7471 batching : true ,
7572 interval : 5 ,
7673 host : options . lokiHost ,
77- labels : { application : "template-service" } ,
74+ labels : { application : packageJson . name } ,
7875 } ,
7976 } ,
8077 } ;
@@ -105,7 +102,7 @@ const app: FastifyPluginAsync<AppOptions> = async (
105102 } ) ;
106103
107104 // Register Metrics
108- await fastify . register ( fastifyMetrics , {
105+ await fastify . register ( fastifyMetrics . default , {
109106 endpoint : "/metrics" ,
110107 defaultMetrics : { enabled : true } ,
111108 } ) ;
You can’t perform that action at this time.
0 commit comments