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:
parent
0dff484ff5
commit
c1862b3228
4 changed files with 14 additions and 7 deletions
4
main.go
4
main.go
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue