Skip to content

Commit

Permalink
[BREAK] Update the default port of the Prometheus exporter (#11351)
Browse files Browse the repository at this point in the history
  • Loading branch information
thaiphv authored and sampaiodiego committed Sep 3, 2018
1 parent 652d373 commit 3132dbc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/rocketchat-lib/server/lib/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ app.use('/metrics', (req, res) => {
res.end(RocketChat.promclient.register.metrics());
});

app.use('/', (req, res) => {
const html = `<html>
<head>
<title>Rocket.Chat Prometheus Exporter</title>
</head>
<body>
<h1>Rocket.Chat Prometheus Exporter</h1>
<p><a href="/metrics">Metrics</a></p>
</body>
</html>`;

res.write(html);
res.end();
});

const server = http.createServer(app);

let timer;
Expand Down
3 changes: 2 additions & 1 deletion packages/rocketchat-lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,8 @@ RocketChat.settings.addGroup('Logs', function() {
type: 'boolean',
i18nLabel: 'Enabled',
});
this.add('Prometheus_Port', 9100, {
// See the default port allocation at https://github.com/prometheus/prometheus/wiki/Default-port-allocations
this.add('Prometheus_Port', 9458, {
type: 'string',
i18nLabel: 'Port',
});
Expand Down

0 comments on commit 3132dbc

Please sign in to comment.