Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 240-metrics.mdx - let -> const #5408

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading