Closed DenisCarriere closed 1 year ago
Only provide Prometheus metrics to single HTTP route /metrics, this makes it easier for other routes to be expanded by other HTTP services.
/metrics
// Create a local server to serve Prometheus metrics export const server = http.createServer(async (req, res) => { if (!req.url) return; if (req.method == "GET") { if (req.url === "/metrics") { res.writeHead(200, { 'Content-Type': prometheus.registry.contentType }); return res.end(await prometheus.registry.metrics()); } } });
Added in commit: https://github.com/pinax-network/substreams-sink/commit/9ffa81024dd133c6ccacc3cd4084f8cb64d4a9ad and bumped up version to v0.9.3
v0.9.3
Published new release
Only provide Prometheus metrics to single HTTP route
/metrics
, this makes it easier for other routes to be expanded by other HTTP services.