|
18 | 18 | import requests |
19 | 19 | import time |
20 | 20 |
|
21 | | -from confygure import config_t |
22 | 21 | from prometheus_client import Counter, Gauge |
23 | | -from prometheus_client import start_http_server |
24 | 22 |
|
25 | 23 |
|
26 | 24 | logger = logging.getLogger(__name__) |
@@ -118,26 +116,3 @@ def register_camera_expectation(camera: str, position: int): |
118 | 116 | :param position: New camera position |
119 | 117 | ''' |
120 | 118 | camera_position_expected.labels(camera).set(position) |
121 | | - |
122 | | - |
123 | | -def start_metrics_exporter(): |
124 | | - '''Start the web server for the metrics exporter endpoint if it is enabled |
125 | | - in the configuration. |
126 | | - ''' |
127 | | - if not config_t(bool, 'metrics', 'enabled'): |
128 | | - return |
129 | | - |
130 | | - supported_args = start_http_server.__code__.co_varnames |
131 | | - if 'certfile' in supported_args: |
132 | | - start_http_server( |
133 | | - port=config_t(int, 'metrics', 'port') or 8000, |
134 | | - addr=config_t(str, 'metrics', 'addr') or '127.0.0.1', |
135 | | - certfile=config_t(str, 'metrics', 'certfile'), |
136 | | - keyfile=config_t(str, 'metrics', 'keyfile')) |
137 | | - else: |
138 | | - if config_t(str, 'metrics', 'certfile'): |
139 | | - logger.warn('Old version of Prometheus client library does not yet' |
140 | | - ' support TLS. Provided certificate will be ignored.') |
141 | | - start_http_server( |
142 | | - port=config_t(int, 'metrics', 'port') or 8000, |
143 | | - addr=config_t(str, 'metrics', 'addr') or '127.0.0.1') |
0 commit comments