Mounting to Starlette app adds trailing '/' #2548
-
I am running a FastAPI server, and mounted a asgi middleware to be able to serve prometheus metrics on the same server at the Now the scrape endpoint can be changed to have a trailing slash, but it involves custom changes to the scrape targets, and via most defaults, I would prefer this to be on the '/metrics' endpoint. I think I found the code section that causes this issue for me routing.py. What do you think? Am I doing something wrong? Or is is a fair use case for this to be configurable? My violating code block: ...
# Add prometheus asgi middleware to route /metrics requests
metrics_app = make_asgi_app()
app.mount(path="/metrics", app=metrics_app)
... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As far as I know, that's the default behavior, not a problem but feature. |
Beta Was this translation helpful? Give feedback.
As far as I know, that's the default behavior, not a problem but feature.