RocketChat / RocketChat/Rocket.Chat
Prometheus set interface
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:
- Go to Logs
- Enable Prometheus
- Enter something like "127.0.0.1:1337" as port
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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