Support Prometheus_client 0.4.0+ (#5636)

This commit is contained in:
Amber Brown 2019-07-18 23:57:15 +10:00 committed by GitHub
parent b2a382efdb
commit 7ad1d76356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 399 additions and 50 deletions

View file

@ -29,8 +29,16 @@ from prometheus_client.core import REGISTRY, GaugeMetricFamily, HistogramMetricF
from twisted.internet import reactor
from synapse.metrics._exposition import (
MetricsResource,
generate_latest,
start_http_server,
)
logger = logging.getLogger(__name__)
METRICS_PREFIX = "/_synapse/metrics"
running_on_pypy = platform.python_implementation() == "PyPy"
all_metrics = []
all_collectors = []
@ -470,3 +478,12 @@ try:
gc.disable()
except AttributeError:
pass
__all__ = [
"MetricsResource",
"generate_latest",
"start_http_server",
"LaterGauge",
"InFlightGauge",
"BucketCollector",
]