Git Product home page Git Product logo

Comments (7)

tom-draper avatar tom-draper commented on July 23, 2024

Hi thanks for raising this issue. This is due to Python version incompatibility. The style of type hints used in the code is only supported by python >= 3.9. I will revert to using the older and the more backwards compatible typing hint system and create a new release that should solve your issue on Python 3.8.

from api-analytics.

tom-draper avatar tom-draper commented on July 23, 2024

Upgrading your api-analytics package to 1.1.3 should solve this issue now. Thanks

from api-analytics.

sachinsdesai avatar sachinsdesai commented on July 23, 2024

Thanks for the quick response Tom.

Not sure if other users of this service have reported this or not, but add_middleware() function does not take 2 positional arguments (latest version of fastapi (0.95.1) as well as 0.92.1) anymore. So, I am struggling with the following line from fastapi-analytics.

app.add_middleware(Analytics, <API-KEY>) # Add middleware

Similar call to add_middleware for CORS support uses the following approach and it works:

app.add_middleware(
    CORSMiddleware,
    allow_origins=['*'],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

from api-analytics.

tom-draper avatar tom-draper commented on July 23, 2024

Oh sorry about that, I think the docs are slightly wrong there. The API key should be passed as a named argument. I'll fix that.

So it should be:
app.add_middleware(Analytics, api_key=<API-KEY>)

from api-analytics.

sachinsdesai avatar sachinsdesai commented on July 23, 2024

Thanks @tom-draper . That took care of the exception - I see that you already updated the documentation!

Made a few API calls (about 10 calls across 3 different API end-points on this API), but it doesn't show in the dashboard. Is there a long lag? Or is there some other issue? The documentation suggests making this middleware call and then directly access the dashboard. Anything that I am missing?

Screen Shot 2023-04-23 at 10 09 13 AM

from api-analytics.

tom-draper avatar tom-draper commented on July 23, 2024

Apologies again! Should be fixed now. Lots of backend upgrades have been made over the past week so there are still a few bugs to iron out. Thanks a lot

from api-analytics.

sachinsdesai avatar sachinsdesai commented on July 23, 2024

Works now. Thanks

from api-analytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.