1
0
Fork 0
forked from External/mediamtx

add ability to configure metrics port

Port could be specified by using either metricsPort config file entry or
RTSP_METRICSPORT environment variable.
This commit is contained in:
Lionel Nicolas 2021-03-13 12:22:02 -05:00 committed by Alessandro Ros
parent 0dff484ff5
commit c1862b3228
4 changed files with 14 additions and 7 deletions

View file

@ -164,6 +164,7 @@ func (p *program) createResources(initial bool) error {
if p.metrics == nil {
p.metrics, err = metrics.New(
p.conf.ListenIP,
p.conf.MetricsPort,
p.stats,
p)
if err != nil {
@ -288,7 +289,8 @@ func (p *program) closeResources(newConf *conf.Conf) {
closeMetrics := false
if newConf == nil ||
newConf.Metrics != p.conf.Metrics ||
newConf.ListenIP != p.conf.ListenIP {
newConf.ListenIP != p.conf.ListenIP ||
newConf.MetricsPort != p.conf.MetricsPort {
closeMetrics = true
}