Closed bhaktatejas922 closed 11 months ago
@bhaktatejas922 how did you resolve this ?
add it before you add the router
`
app = FastAPI()
origins = ["*"]
@app.get("/health")
def get_health():
return {"status": "OK"}
app.add_middleware(
CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"]
)
Instrumentator().instrument(app).expose(app, endpoint="/api/v1/metrics")
app.include_router(router)
`
@bhaktatejas922 Thanks that works !
Hey,
Trying to use this in a FastAPI app with many routers
It only seems to get metrics at the root, are openapi.json and /docs and nothing else