Skip to content

Commit

Permalink
Merge branch 'main' into turso-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ruheni authored Nov 1, 2023
2 parents d98a22b + eedcc8a commit 39315b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,12 @@ The command output contains helpful information on how to use the generated file

<CodeWithResult outputResultText="Prisma schema" expanded={true}>

<cmd>```terminal prisma init --preview-feature multiSchema```</cmd>
<cmd>

```terminal
prisma init --preview-feature multiSchema
```
</cmd>

<cmdResult>

Expand Down

0 comments on commit 39315b3

Please sign in to comment.