epsagon-python
epsagon-python copied to clipboard
FastAPI Issue
After installing epsagon on my FastAPI application, I get the following error: (route) got an unexpected keyword argument 'epsagon_request'
My configuration is pretty straight forward:
epsagon.init( token='token, app_name='my-app', metadata_only=False, )
Hi @eyalabadi98, can you share your fastapi version? It would also be helpful if you got a reproducible.
Hi @ranrib ,
This example causes the issue:
from fastapi import FastAPI
from fastapi.exceptions import RequestValidationError
from starlette.exceptions import HTTPException
from starlette.middleware.cors import CORSMiddleware
import uvicorn
import epsagon
epsagon.init(
token='Test',
app_name='Test',
metadata_only=False,
)
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
def start():
"""Launched with `poetry run start` at root level"""
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
Versions:
python = "^3.9" epsagon = "^1.81.0" fastapi = "^0.85.0" uvicorn = "^0.18.3"
Hi, please add the following env var:
EPSAGON_FASTAPI_ASYNC_MODE=TRUE
This should solve the issue