RocketChat / RocketChat/Rocket.Chat

Prometheus set interface

Open
#13,692 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

If i enable Prometheus Metrics by ticking the box in the admin interface/Logs, Rocketchat binds the selected port on all available interfaces, which exposes the information publicly. Since i'm using a reverse proxy i would love to bind the metrics to the loopback only.

I can enter the ip address in the webinterface with no error, but the port never opens then.

Steps to reproduce:
  1. Go to Logs
  2. Enable Prometheus
  3. Enter something like "127.0.0.1:1337" as port
  4. Save and restart
Expected behavior:

Port 1337 with Prometheus metrics opens at 127.0.0.1

Actual behavior:

No port opens at all, no errors in logging.

Server Setup Information:
  • Version of Rocket.Chat Server: 0.74.2
  • Operating System: Ubuntu Linux
  • Deployment Method: manual
Additional context

Binding to a specific interface could help to control access to metrics with allow/deny directives in the reverse proxy, also could provide TLS encryption.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the Logs admin interface and trace how the Prometheus address is parsed and passed to the metrics listener. Reproduce the configuration with 127.0.0.1:1337, then verify that metrics bind only to that interface and that invalid or existing configurations still report appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
prometheus, typescript
Domain
backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.