Skip to content

Commit 4dbe382

Browse files
committed
Fix prometheus server tests, upgrade dependencies
1 parent 4d3f1d6 commit 4dbe382

File tree

4 files changed

+65
-185
lines changed

4 files changed

+65
-185
lines changed

packages/common-ts/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Changed
9+
- Upgrade dependencies
10+
11+
### Fixed
12+
- Fix serve metrics test
813

914
## [1.5.1] - 2021-05-11
1015
### Added

packages/common-ts/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"cors": "2.8.5",
2626
"cross-fetch": "3.1.4",
2727
"ethers": "5.5.2",
28-
"express": "4.17.1",
29-
"graphql": "16.1.0",
28+
"express": "4.17.2",
29+
"graphql": "16.2.0",
3030
"graphql-tag": "2.12.6",
3131
"helmet": "4.6.0",
3232
"morgan": "1.10.0",
@@ -42,11 +42,11 @@
4242
"@types/bs58": "4.0.1",
4343
"@types/cors": "2.8.12",
4444
"@types/express": "4.17.13",
45-
"@types/jest": "26.0.15",
45+
"@types/jest": "27.0.3",
4646
"@types/lodash.isequal": "4.5.5",
4747
"@types/morgan": "1.9.3",
4848
"@types/ngeohash": "0.6.4",
49-
"@types/node": "17.0.1",
49+
"@types/node": "17.0.2",
5050
"@types/pino": "7.0.5",
5151
"@types/pino-multi-stream": "5.1.3",
5252
"@types/supertest": "2.0.11",

packages/common-ts/src/metrics/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ export const createMetricsServer = (options: MetricsServerOptions): Server => {
3232

3333
const app = express()
3434

35-
app.get(options.route || '/metrics', (_, res) => {
36-
res.status(200).send(options.registry.metrics())
35+
app.get(options.route || '/metrics', async (_, res) => {
36+
res.set('Content-Type', options.registry.contentType)
37+
res.status(200).send(await options.registry.metrics())
3738
})
3839

3940
const port = options.port || 7300

0 commit comments

Comments
 (0)