From 705c5fca4c3e8f1846cfdb7f08be58b4bc54ceab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Galeran?= Date: Tue, 31 Oct 2023 11:05:30 +0100 Subject: [PATCH] Update 240-metrics.mdx - let -> const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was no good reason to use `let` that I could think of here 🤔 --- .../100-components/02-prisma-client/240-metrics.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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)