Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start_http_server with make_asgi_app? #987

Closed
mecampbellsoup opened this issue Dec 13, 2023 · 1 comment
Closed

start_http_server with make_asgi_app? #987

mecampbellsoup opened this issue Dec 13, 2023 · 1 comment

Comments

@mecampbellsoup
Copy link

mecampbellsoup commented Dec 13, 2023

Hi guys,

Quick question and hopefully not a dumb one but, nevertheless:

start_http_server only works with make_wsgi_app - is there anything preventing one from doing something similar with make_asgi_app instead?

An alternative is to install prometheus-async which has its own start_http_server.

We have a FastAPI + uvicorn (ASGI) application and are looking to expose some Prometheus metrics for export.

@LordKa0S
Copy link

LordKa0S commented Jan 25, 2024

from fastapi import FastAPI
import prometheus_client

app = FastAPI()
metrics_app = prometheus_client.make_asgi_app()
app.mount("/metrics", metrics_app)

Originally posted by @pquentin in #512 (comment)

@prometheus prometheus locked and limited conversation to collaborators Jan 25, 2024
@csmarchbanks csmarchbanks converted this issue into discussion #1000 Jan 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants