graphite #1
Description
Graphite consists of a storage backend and a web-based visualization frontend. Client applications send streams of numeric time-series data to the Graphite backend (called carbon), where it gets stored in fixed-size database files similar in design to RRD. The web frontend provides 2 distinct user interfaces for visualizing this data in graphs as well as a simple URL-based API for direct graph generation. Graphite's design is focussed on providing simple interfaces (both to users and applications), real-time visualization, high-availability, and enterprise scalability.
- Tags:
- applications ›
Graphite charm
This charm will install Graphite. You will also need something like gunicorn or apache in front of it.
Example Usage
Deploy Services
$ make deploy
If you would like to deploy with postgres instead of sqlite3 you will also need to deploy postgres and add the relation:
$ juju add-relation graphite:pgsql postgres:db
Adding data to graphite
This charm does not currently support relations with other services that would generate statistics to be added to it. You will need to manually configure services to connect to the graphite instance and pass it the statistics you need. This is partially due to juju's current lack of cross-environment relations (i.e. you may well want to set up one graphite instance that can accept data from multiple juju environments), but could be solved at some point by a proxy charm that know the location of a central graphite server and allows multiple juju environments to connect to the same graphite server.
from txstatsd.client import UdpStatsDClient from txstatsd.metrics.metrics import Metrics conn = UdpStatsDClient(host='127.0.0.1', port=8125) # replace IP with graphite deployment IP conn.connect() METRICS = Metrics(connection=conn, namespace='my-project') # replace namespace as needed METRICS.meter('foobar', 1) METRICS.meter('foobar', 10)
Note about Dependencies
The makefile to run tests requires the following dependencies
- python-nose
- python-mock
- python-flake8
installable via:
$ sudo apt-get install python-nose python-mock python-flake8
NOTE:
Presently the graphite charm only works with one graphite instance deployed or one graphite and one postgresql instance deployed. It is not presently able to scale out further than that.
Configuration
- ansible_location
- (string) Repository from which to install ansible
- ppa:canonical-ci-engineering/ci-airline-phase-0
- ansible_ppa
- (boolean) Install ansible from a PPA
- True
- base_dir
- (string) Base directory for deployment
- graphite
- extra_repository
- (string) The PPA location of the graphite packages. Leave blank to use distro archives.
- ppa:canonical-ci-engineering/ci-airline-phase-0
- instance_type
- (string) Instance type (development, staging or production).
- development
- port
- (int) Port to use for accessing via gunicorn
- 8080
- secret_key
- (string) The web site secret key.
- CHANGEME
- storage_schema
- (string) Default is the storage-schemas example as provided by graphite-carbon. If a custom schema is needed, please place it in the files/ directory and change this to files/<filename.conf>
- /usr/share/doc/graphite-carbon/examples/storage-schemas.conf.example
- wsgi_group
- (string) Switch worker process to run as this group. A valid group id (as an int) or the name.
- www-data
- wsgi_user
- (string) Switch worker processes to run as this user. User id (as an int) or the name.
- www-data