diff --git a/config.yaml b/config.yaml index 45b5671..c167b61 100644 --- a/config.yaml +++ b/config.yaml @@ -259,6 +259,9 @@ influxdb: password: examplePassword database: example +prometheus: + port: 9191 + snmp: port: 1161 listen_address: 127.0.0.1 diff --git a/docker/config.yaml b/docker/config.yaml index 36ac7c7..30810ce 100644 --- a/docker/config.yaml +++ b/docker/config.yaml @@ -205,6 +205,9 @@ influxdb: password: "${INFLUXDB_PASSWORD:-examplePassword}" database: "${INFLUXDB_DATABASE:-example}" +prometheus: + port: ${PROMETHEUS_PORT:-9191} + snmp: port: ${SNMP_PORT:-1161} listen_address: "${SNMP_LISTEN_ADDRESS:-127.0.0.1}" diff --git a/services/metricService.py b/services/metricService.py index af6a316..0c2ad5e 100755 --- a/services/metricService.py +++ b/services/metricService.py @@ -138,7 +138,8 @@ def main(): '/metrics': make_wsgi_app(registry=metricService.registry) }) - prometheusWebClient.run(host='0.0.0.0', port=9191) + prometheusPort = config.get('prometheus', {}).get('port', 9191) + prometheusWebClient.run(host='0.0.0.0', port=prometheusPort) if __name__ == '__main__': diff --git a/tests/config.yaml b/tests/config.yaml index b855d80..8d18d69 100644 --- a/tests/config.yaml +++ b/tests/config.yaml @@ -100,6 +100,9 @@ redis: influxdb: enabled: False +prometheus: + port: 9191 + snmp: port: 1161 listen_address: 127.0.0.1