Skip to content

Commit

Permalink
path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sholdee committed Jun 27, 2024
1 parent 5681da3 commit f67f6a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion adguard_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ def combined_app(environ, start_response):
return health_server.livez(environ, start_response)
elif environ['PATH_INFO'] == '/readyz':
return health_server.readyz(environ, start_response)
return make_wsgi_app()(environ, start_response)
elif environ['PATH_INFO'] == '/metrics':
return make_wsgi_app()(environ, start_response)
status = '403 Forbidden'
headers = [('Content-type', 'text/plain; charset=utf-8')]
start_response(status, headers)
return [b"Forbidden"]

httpd = make_server('', port, combined_app)
logger.info(f"Prometheus metrics server started on port {port}, /metrics, /livez, and /readyz endpoints")
Expand Down

0 comments on commit f67f6a5

Please sign in to comment.