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

Add Starlette integration #349

Merged
merged 21 commits into from
Nov 5, 2019
Merged

Add Starlette integration #349

merged 21 commits into from
Nov 5, 2019

Conversation

adamchainz
Copy link
Contributor

Fixes #233 .

Basic Starlette integration that tracks HTTP only. Websocket implementation would be a bit more fun.

try:
from asgiref.local import Local
except ImportError:
from threading import local as Local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if they are not running Python 3.5+ with asgiref, we fall back to using Treading.local, which will not support async tracking, correct?

I wonder if we should log a line that syas something to that effect: Async tracking unavailable (Requires Python 3.5+) or similar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only in Python 3.5 that the async functionality was added to Python so that wouldn't really add any information :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I had thought Python had async for longer. Nevermind, then!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's been gevent and other styles of async for a while - in general it's a confusing landscape. Still need to get around to official gevent support in #28.

adamchainz added a commit to adamchainz/slate_apm_help that referenced this pull request Nov 5, 2019
@adamchainz adamchainz merged commit 140451e into master Nov 5, 2019
@adamchainz adamchainz deleted the issue_233_starlette branch November 5, 2019 09:46
dlanderson pushed a commit to scoutapp/slate_apm_help that referenced this pull request Nov 13, 2019
* Document Starlette integration
Document the integration added in scoutapp/scout_apm_python#349 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Starlette framework
2 participants