You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that this way of prometheus metrics server starting, which code is
class _ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
"""Thread per request HTTP server."""
def start_http_server(port, addr='', registry=REGISTRY):
"""Starts an HTTP server for prometheus metrics as a daemon thread"""
CustomMetricsHandler = MetricsHandler.factory(registry)
httpd = _ThreadingSimpleServer((addr, port), CustomMetricsHandler)
t = threading.Thread(target=httpd.serve_forever)
t.daemon = True
t.start()
is starting the server, which has memory leaks. I found it by profiling app with tracemalloc library. This server is infinitely opening new threads. I think this behavior must be specified in the docs.
The text was updated successfully, but these errors were encountered:
I found that this way of prometheus metrics server starting, which code is
is starting the server, which has memory leaks. I found it by profiling app with
tracemalloc
library. This server is infinitely opening new threads. I think this behavior must be specified in the docs.The text was updated successfully, but these errors were encountered: