Scope agent for Python
Reason this release was yanked:
Scope has shutdown
Project description
python-agent
Python agent for Scope
Install
pip install scopeagent
Usage
First, get an API key from your Scope installation.
Then, prefix your startup command with scope-run
:
scope-run -k $APIKEY python run my_app.py
scope-run -k $APIKEY gunicorn myapp.wsgi
scope-run -k $APIKEY python -m unittest discover
Parameters
Flag | Required? | Default | Description | Environment variable |
---|---|---|---|---|
-k , --apikey |
Y | API key tog use when sending data to Scope | $SCOPE_APIKEY |
|
-n , --name |
N | default |
Service name to use when sending data to Scope | $SCOPE_SERVICE |
-c , --commit |
N | $(git rev-parse HEAD) |
Commit hash to use when sending data to Scope | $SCOPE_COMMIT_SHA |
-r , --repository |
N | Looked up automatically | Repository ID to use when sending data to Scope | $SCOPE_REPOSITORY |
--root |
N | $(git rev-parse --show-toplevel) |
Repository root path | $SCOPE_SOURCE_ROOT |
Advanced usage
If the above doesn't work for your specific setup, you can also install the Scope Agent by running the following as early as possible in your code (as it needs to patch supported libraries):
import scopeagent
agent = scopeagent.Agent(api_key="xxxxxxxx", commit="abc123", repository="github.com|1234")
agent.install()
Supported libraries
Name | Span/event creation | Extract | Inject |
---|---|---|---|
celery |
* | ||
gunicorn |
* | * | |
requests |
* | * | |
unittest |
* | ||
kombu |
* | * | * |
logging |
* |
Development
Automated Testing
The following environment variables are used for database tests:
POSTGRES_DBURL
Acknowledgements
Some code is copied from or inspired by Uber's opentracing-python-instrumentation (MIT license). The original copyright notice is maintained in copied files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scopeagent-0.2.0.tar.gz
(25.5 kB
view hashes)
Built Distribution
scopeagent-0.2.0-py3-none-any.whl
(46.2 kB
view hashes)
Close
Hashes for scopeagent-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9f11394396a255ec18fbc8e2447d2ce3fb0898c58220495ec9fb50975e5d65 |
|
MD5 | c4d2c3c231524bc17935ab038fd06565 |
|
BLAKE2b-256 | d1c33d49a16f36a906b2c8c20bfcedd0fcdf30558a9f808a0e5f596c4d916429 |