def make_wsgi_app(registry=REGISTRY):
def prometheus_app(environ, start_response):<EOL><INDENT>params = parse_qs(environ.get('<STR_LIT>', '<STR_LIT>'))<EOL>r = registry<EOL>encoder, content_type = choose_encoder(environ.get('<STR_LIT>'))<EOL>if '<STR_LIT>' in params:<EOL><INDENT>r = r.restricted_registry(params['<STR_LIT>'])<EOL><DEDENT>output = encoder(r)<EOL>status = str('<STR_LIT>')<EOL>headers = [(str('<STR_LIT>'), content_type)]<EOL>start_response(status, headers)<EOL>return [output]<EOL><DEDENT>return prometheus_app<EOL>
Create a WSGI app which serves the metrics from a registry.