Instrumental is a application monitoring platform built for developers who want a better understanding of their production software. Powerful tools, like the Instrumental Query Language, combined with an exploration-focused interface allow you to get real answers to complex questions, in real-time.
This agent supports custom metric monitoring for Python applications, compatible with Python 2 and Python 3. It provides high-data reliability at high scale, without ever blocking your process or causing an exception.
pip install --upgrade instrumental_agent
or
easy_install --upgrade instrumental_agent
If you are on a system with easy_install
but not pip
, you can use easy_install
instead. If you're not using virtualenv
, you may have to prefix those commands with sudo
.
Visit instrumentalapp.com and create an account, then initialize the agent with your API token, found in the token documentation.
from instrumental_agent import Agent
i = Agent("PROJECT_API_TOKEN", enabled=True)
You'll probably want something like the above, only enabling the agent in production mode so you don't have development and production data writing to the same place. Or you can setup two projects, so that you can verify stats in one, and release them to production in another.
Now you can begin to use Instrumental to track your application.
i.gauge('load', 1.23) # value at a point in time
i.increment('signups') # increasing value, think "events"
i.time('query_time', lambda: Post.find(1)) # time a method call
i.time_ms('query_time', lambda: Post.find(1)) # prefer milliseconds?
Note: For your app's safety, the agent is meant to isolate your app from any problems our service might suffer. If it is unable to connect to the service, it will discard data after reaching a low memory threshold.
Want to track an event (like an application deploy, or downtime)? You can capture events that are instantaneous, or events that happen over a period of time.
i.notice('Jeffy deployed rev ef3d6a') # instantaneous event
i.notice('Testing socket buffer increase', time.time(), timedelta(minutes=20)) # an event with a duration
Want server stats like load, memory, etc.? Check out InstrumentalD.
- Pull latest master
- Merge feature branch(es) into master
script/test
- Increment version in:
setup.py
instrumental_agent/agent.py
- Update CHANGELOG.md
- Commit "Release vX.Y.Z"
- Push to GitHub
- Tag version:
git tag 'vX.Y.Z' && git push --tags
- Build packages
python setup.py sdist bdist_wheel
- Upload packages
twine upload dist/*
- Update documentation on instrumentalapp.com
This library follows Semantic Versioning 2.0.0.