Skip to main content

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

scopeagent-0.3.1.tar.gz (26.9 kB view hashes)

Uploaded Source

Built Distribution

scopeagent-0.3.1-py3-none-any.whl (47.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page