Skip to content

Commit 347b286

Browse files
chore: cherry pick PR #2734 (#2735)
fix: The relay metrics are not exposed in the websocket server (#2734) Signed-off-by: Victor Yanev <[email protected]> Signed-off-by: Logan Nguyen <[email protected]> Revert "fix: The relay metrics are not exposed in the websocket server (#2734)" This reverts commit 0d5bd6b. Reapply "fix: The relay metrics are not exposed in the websocket server (#2734)" This reverts commit f39638840544685865994b4fa976b86f7671162c. Co-authored-by: Victor Yanev <[email protected]>
1 parent c4b8a81 commit 347b286

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/ws-server/src/webSocketServer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import pino from 'pino';
2424
import dotenv from 'dotenv';
2525
import { v4 as uuid } from 'uuid';
2626
import websockify from 'koa-websocket';
27-
import { Registry } from 'prom-client';
27+
import { collectDefaultMetrics, Registry } from 'prom-client';
2828
import { getRequestResult } from './controllers';
2929
import { WS_CONSTANTS } from './utils/constants';
3030
import { formatIdMessage } from './utils/formatters';
@@ -202,6 +202,8 @@ app.ws.use(async (ctx) => {
202202
});
203203

204204
const httpApp = new KoaJsonRpc(logger, register).getKoaApp();
205+
collectDefaultMetrics({ register, prefix: 'rpc_relay_' });
206+
205207
httpApp.use(async (ctx, next) => {
206208
// prometheus metrics exposure
207209
if (ctx.url === '/metrics') {

0 commit comments

Comments
 (0)