Skip to content
Snippets Groups Projects
Commit 8aaa4a63 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

v2.16.6

parent ce27e267
No related branches found
No related tags found
No related merge requests found
# v2.16.6
* trace_exception can take None as an argument
* added option to specify a custom metric source for
__version__ = '2.16.6a2'
__version__ = '2.16.6'
......@@ -18,7 +18,7 @@ class PrometheusHandler(http.server.BaseHTTPRequestHandler):
self.send_error(404, 'Unknown path. Only /metrics is supported.')
return
metric_data = getMetric().to_metric_data()
metric_data = self.server.get_metric_data()
metric_data.add_labels(self.server.extra_labels)
metric_data = metric_data_collection_to_prometheus(metric_data)
self.send_response(200)
......@@ -62,6 +62,14 @@ class PrometheusHTTPExporterThread(TerminableThread):
self.httpd.serve_forever()
self.httpd.server_close()
def get_metric_data(self) -> MetricDataCollection:
"""
Obtain metric data.
Overload to provide custom source of metric data.
"""
return getMetric().to_metric_data()
def terminate(self, force: bool = False) -> 'PrometheusHTTPExporterThread':
"""
Order this thread to terminate and return self.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment