Skip to content

Commit 242cd3a

Browse files
author
Alan Shaw
authored
fix: metrics exposition format (#614)
1 parent c04e2f7 commit 242cd3a

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

packages/api/src/routes-v1/metrics.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,18 @@ async function exportPromMetrics() {
8181
'# TYPE nftstorage_users_total counter',
8282
`nftstorage_users_total ${users.total}`,
8383

84+
'# HELP nftstorage_uploads_total Total number of uploads by type.',
85+
'# TYPE nftstorage_uploads_total counter',
8486
...Object.entries(nfts.totals).map(([type, total]) =>
85-
[
86-
`# HELP nftstorage_uploads_total Total number of ${type} uploads.`,
87-
'# TYPE nftstorage_uploads_total counter',
88-
`nftstorage_uploads_total{type:"${type}"} ${total}`,
89-
].join('\n')
87+
`nftstorage_uploads_total{type:"${type}"} ${total}`
9088
),
9189

90+
'# HELP nftstorage_pins_total Total number of pins by service and status.',
91+
'# TYPE nftstorage_pins_total counter',
9292
...Object.entries(pins.totals).map(([service, totals]) => {
9393
return Object.entries(totals)
9494
.map(([status, total]) =>
95-
[
96-
`# HELP nftstorage_pins_total Total number of ${service} pins that are ${status}.`,
97-
'# TYPE nftstorage_pins_total counter',
98-
`nftstorage_pins_total{service:"${service}",status:"${status}"} ${total}`,
99-
].join('\n')
95+
`nftstorage_pins_total{service:"${service}",status:"${status}"} ${total}`
10096
)
10197
.join('\n')
10298
}),

0 commit comments

Comments
 (0)