Skip to content

Commit

Permalink
Update 240-metrics.mdx - let -> const
Browse files Browse the repository at this point in the history
There was no good reason to use `let` that I could think of here 🤔
  • Loading branch information
Jolg42 authored Oct 31, 2023
1 parent 9a55991 commit 705c5fc
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```

Expand Down Expand Up @@ -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)
```

Expand Down Expand Up @@ -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)
})

Expand All @@ -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)
})

Expand All @@ -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)
Expand Down

0 comments on commit 705c5fc

Please sign in to comment.