Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASGI - Starlette/Fast API Framework #5

Closed
rr0214 opened this issue Jul 16, 2020 · 2 comments
Closed

ASGI - Starlette/Fast API Framework #5

rr0214 opened this issue Jul 16, 2020 · 2 comments

Comments

@rr0214
Copy link

rr0214 commented Jul 16, 2020

Overview:

Starlette is a lightweight ASGI framework/toolkit, which is ideal for building high performance asyncio services. It supports both HTTP and WebSockets. With over 500K downloads a month, it is growing rapidly in popularity: https://pypistats.org/packages/starlette

Currently, customers will not see see data in NR when monitoring their Starlette ASGI application. This MMF addresses this, giving those customers visibility their transactions and downstream services.

The key is to show transactions data and ensure they can also view those transactions are viewable in DT.

Acceptance Criteria:

  • Extract and send web-transaction events (start/end time) for http requests (not web sockets since they do not create transactions, since this can cause memory explosion for long-running transactions)

  • Attach appropriate attributes to those events i.e.

    • number of bytes on output automatically captured
    • Request headers automatically captured
    • Request method
    • Request URI
    • Response headers
    • Response status
  • Send span event data / trace id? (goal here to to ensure those transactions translate to a span and there is an id that is passed from the transaction to the external service so we can track them in DT view.

  • Add to New Relic docs and website that we offer Starlette support

  • Units Tests

  • Demo

@a-recknagel
Copy link

Glad to see this. Starlette is an amazing framework and is, in conjunction with fastapi, seeing a lot of adoption.

Just in case you're planning to leverage exclusively newrelic.agent.register_application in application code or newrelic-admin run-program from the command line to patch in the agent, could you also expose a middleware similar to this? It would make integration a lot easier.

@rr0214 rr0214 changed the title ASGI - Starlette Framework ASGI - Starlette/FastAPI Framework Sep 21, 2020
@rr0214 rr0214 changed the title ASGI - Starlette/FastAPI Framework ASGI - Starlette/Fast API Framework Sep 24, 2020
@danielapsmaior
Copy link

There's a bug in previous version that I assume it's happening only in FastAPI. I opened this issue.

@a-feld a-feld closed this as completed Oct 22, 2020
tdg5 pushed a commit to tdg5/newrelic-python-agent that referenced this issue Jun 12, 2023
graphql hook newrelic#4 DID NOT cause the regression
tdg5 pushed a commit to tdg5/newrelic-python-agent that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants