INNER CODE UNIT · TypeScript
nodeMetricsPort
OutlineFoundation/outline-server · src/shadowbox/server/main.ts:129
const nodeMetricsPort = await portProvider.reserveFirstFreePort(prometheusPort + 1);
exportPrometheusMetrics(prometheus.register, nodeMetricsPort);
const nodeMetricsLocation = `127.0.0.1:${nodeMetricsPort}`;
const ssMetricsPort = await portProvider.reserveFirstFreePort(nodeMetricsPort + 1);
logging.info(`Prometheus is at ${prometheusLocation}`);
logging.info(`Node metrics is at ${nodeMetricsLocation}`);
const prometheusConfigJson = {
global: {
scrape_interval: '1m',
},
scrape_configs: [
{job_name: 'prometheus', static_configs: [{targets: [prometheusLocation]}]},
{job_name: 'outline-server-main', static_configs: [{targets: [nodeMetricsLocation]}]},
],
};