Merge pull request #445 from christian-2/issue-421

ability for Prometheus exporter to listen on localhost
This commit is contained in:
Mészáros Mihály 2020-06-05 21:28:35 +02:00 committed by GitHub
commit a4e506d60f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -115,6 +115,9 @@ To integrate with an LMS (e.g. Moodle), have a look at [LTI](LTI/LTI.md).
* You need an additional [TURN](https://github.com/coturn/coturn)-server for clients located behind restrictive firewalls! Add your server and credentials to `app/config.js`
## Prometheus monitoring
To enable the exporter, have a look at [prom](prom.md).
## Community-driven support
* Open mailing list: community@lists.edumeet.org

View file

@ -46,7 +46,7 @@ on the allocated port (see `/etc/ferm/ferm.conf`).
| | | | | |
| mediasoup | | express socket.io | net | express |
+-----+-----+ +----+---------+-----+-----+-------+-----+----+
^ min-max ^ 443 ^ 443 ^ sock ^ PROM_PORT
^ min-max ^ 443 ^ 443 ^ sock ^ 8889
| RTP | HTTPS | ws | | HTTP
| | | | |
| +-+---------+-+ +------+------+ +---+--------+

View file

@ -396,6 +396,7 @@ module.exports =
/*
prometheus: {
deidentify: false, // deidentify IP addresses
// listen: 'localhost', // exporter listens on this address
numeric: false, // show numeric IP addresses
port: 8889, // allocated port
quiet: false // include fewer labels

View file

@ -242,6 +242,7 @@ module.exports = async function(rooms, peers, config)
try
{
logger.debug(`config.deidentify=${config.deidentify}`);
logger.debug(`config.listen=${config.listen}`);
logger.debug(`config.numeric=${config.numeric}`);
logger.debug(`config.port=${config.port}`);
logger.debug(`config.quiet=${config.quiet}`);
@ -270,12 +271,13 @@ module.exports = async function(rooms, peers, config)
res.end(data);
});
const server = app.listen(config.port || 8889, () =>
{
const address = server.address();
const server = app.listen(config.port || 8889,
config.listen || undefined, () =>
{
const address = server.address();
logger.info(`listening ${address.address}:${address.port}`);
});
logger.info(`listening ${address.address}:${address.port}`);
});
}
catch (err)
{