Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit 4fd8338

Browse files
committed
seperate metrics server
1 parent b3f970b commit 4fd8338

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

substream-listener/src/index.mts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,6 @@ const router = createRouter({
110110
message: "Webhook registered",
111111
});
112112
},
113-
})
114-
.route({
115-
path: "/metrics",
116-
method: "GET",
117-
async handler() {
118-
const metrics = await registry.metrics();
119-
return new Response(metrics, {
120-
headers: {
121-
"Content-Type": registry.contentType,
122-
},
123-
});
124-
},
125113
});
126114

127115
App()
@@ -130,7 +118,11 @@ App()
130118
console.info(`Server is listening on http://localhost:4040/v1/docs`);
131119
});
132120

133-
// sendWebhook({
134-
// appId: "72d9f03b-62b0-4b02-9136-039d0aa20d30",
135-
// startBlock: 13707413,
136-
// });
121+
App()
122+
.get("/metrics", async (res) => {
123+
res.writeHeader("Content-Type", registry.contentType);
124+
res.end(await registry.metrics());
125+
})
126+
.listen(10_254, () => {
127+
console.info(`Metrics exposed on http://localhost:10254/metrics`);
128+
});

0 commit comments

Comments
 (0)