From fd51bfc2db9c4a36174e52e50b93710ce78cc319 Mon Sep 17 00:00:00 2001 From: Carsten Date: Mon, 23 Feb 2026 16:22:05 +0100 Subject: [PATCH] Update metricService to use configurable Prometheus port; add port configuration to YAML files --- config.yaml | 3 +++ docker/config.yaml | 3 +++ services/metricService.py | 3 ++- tests/config.yaml | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.yaml b/config.yaml index 45b5671e..c167b61b 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 36ac7c7b..30810ce4 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 af6a316a..0c2ad5e2 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 b855d802..8d18d699 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