We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7a9ea0d + 09a0bf8 commit 13693aeCopy full SHA for 13693ae
os_capacity/prometheus.py
@@ -1,5 +1,6 @@
1
#!/usr/bin/env python3
2
3
+import os
4
import collections
5
import json
6
import time
@@ -343,7 +344,12 @@ def collect(self):
343
344
345
346
if __name__ == "__main__":
- prom_client.start_http_server(9000)
347
+ kwargs = {
348
+ "port": int(os.environ.get('OS_CAPACITY_EXPORTER_PORT', 9000)),
349
+ "addr": os.environ.get('OS_CAPACITY_EXPORTER_LISTEN_ADDRESS', '0.0.0.0'),
350
+ }
351
+ prom_client.start_http_server(**kwargs)
352
+
353
prom_core.REGISTRY.register(OpenStackCapacityCollector())
354
# there must be a better way!
355
while True:
0 commit comments