Scope agent for Python
Reason this release was yanked:
Scope is 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 python run my_app.py
scope-run gunicorn myapp.wsgi
scope-run 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 |
|
-e , --api-endpoint |
Y | API endpoint of the Scope installation to send data to | $SCOPE_API_ENDPOINT |
|
-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 | $(git remote get-url origin) |
Repository URL to use when sending data to Scope | $SCOPE_REPOSITORY |
--root |
N | $(git rev-parse --show-toplevel) |
Repository root path | $SCOPE_SOURCE_ROOT |
Commit, repository, and source root information will automatically be detected if running on CircleCI or Jenkins via environment variables.
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", api_endpoint="https://scope.mycompany.corp")
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
Built Distribution
Hashes for scopeagent-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6101771b1f134b7d94aafdd9b5d5e2c1f13fe980c5ecad667096e9424084bd82 |
|
MD5 | f24b2531fb8fac53f77235b4a5859352 |
|
BLAKE2b-256 | aceb1262dca703ca0949daad2b6d2bf3a6640c07498b42d0d413323288bb301e |