Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAK] Update the default port of the Prometheus exporter #11351

Merged
merged 4 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1718,7 +1718,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