I'm working on a fastapi sample app and have the folowing simple code:
from typing import Union
from fastapi import FastAPI
from autometrics.autometrics import autometrics
from prometheus_client import start_http_server
app = FastAPI()
@autometrics
@app.get("/")
async def read_root():
do_something()
return {"Hello": "World"}
start_http_server(8080)
# looking up this function in prometheus works
@autometrics
def do_something():
print("done")
In this case do_something does get picked up by prometheus (running on 9090) but read_root does not. I don't know if its the chaining/order of the decorators. Changing the order of the decorators in the read_root actually breaks the handler.
I'm working on a fastapi sample app and have the folowing simple code:
In this case
do_something
does get picked up by prometheus (running on 9090) butread_root
does not. I don't know if its the chaining/order of the decorators. Changing the order of the decorators in theread_root
actually breaks the handler.