diff --git a/content/200-concepts/100-components/02-prisma-client/240-metrics.mdx b/content/200-concepts/100-components/02-prisma-client/240-metrics.mdx index 34ae28abb7..707d97c1c1 100644 --- a/content/200-concepts/100-components/02-prisma-client/240-metrics.mdx +++ b/content/200-concepts/100-components/02-prisma-client/240-metrics.mdx @@ -82,7 +82,7 @@ When you retrieve metrics in JSON format, you can use them in the format they ar To retrieve metrics in JSON format, add the following lines to your application code: ```ts -let metrics = await prisma.$metrics.json() +const metrics = await prisma.$metrics.json() console.log(metrics) ``` @@ -343,7 +343,7 @@ When you retrieve Prisma metrics in Prometheus format, you can use them in the f To retrieve metrics in Prometheus format, add the following lines to your application code: ```ts -let metrics = await prisma.$metrics.prometheus() +const metrics = await prisma.$metrics.prometheus() console.log(metrics) ``` @@ -485,7 +485,7 @@ const port = 4000 const prisma = new PrismaClient() app.get('/metrics', async (_req, res: Response) => { - let metrics = await prisma.$metrics.prometheus() + const metrics = await prisma.$metrics.prometheus() res.end(metrics) }) @@ -509,8 +509,8 @@ const register = new prom.Registry() prom.collectDefaultMetrics({ register }) app.get('/metrics', async (_req, res: Response) => { - let prismaMetrics = await prisma.$metrics.prometheus() - let appMetrics = await register.metrics() + const prismaMetrics = await prisma.$metrics.prometheus() + const appMetrics = await register.metrics() res.end(prismaMetrics + appMetrics) }) @@ -528,7 +528,7 @@ Global labels work with JSON and Prometheus-formatted metrics. For example, to add global labels to JSON-format metrics, add the following code to your application: ```ts -let metrics = prisma.$metrics.json({ +const metrics = prisma.$metrics.json({ globalLabels: { server: 'us_server1', app_version: 'one' }, }) console.log(metrics)