Graphite Pager
Graphite is a great tool for recording metrics but it isn’t easy to get paged when a metric passes a certain threshold.
Graphite-Pager is an easy to use alerting tool for Graphite that will send notification alerts if a metric reaches a warning or critical level.
Requirements
Python 2.7+
Graphite
Redis
libmagic
Installation
Using PIP:
From Github:
pip install git+git://github.com/seatgeek/graphitepager.git@0.2.11#egg=graphitepager
From PyPI:
pip install graphitepager==0.2.11
Running
At the moment the easiest way to install Graphite-Pager is with Heroku! See the example at https://github.com/philipcristiano/graphite-pager-heroku-example.
Set Environment variables:
export GRAPHITE_USER=HTTP-basic username export GRAPHITE_PASS=HTTP-basic password export GRAPHITE_URL=HTTPS(hopefully) URL to your Graphite installation export PAGERDUTY_KEY=Specific PagerDuty application key export REDIS_URL=redis://localhost:6379/ # REDISTOGO_URL is also supportedSet up alerts in the alerts.yml file
Run graphite-pager:
graphite-pager --config alerts.yml
Where the file alerts.yml is in the following format.
Environment variables can also be specified in the yaml file at the top level. Simply change the casing of the environment variable to lowercase like so:
redis_url: "redis://localhost:6379/"
Configuration of Alerts
Configuration of alerts is handled by a YAML file. This can be verified with
graphite-pager verfify --config=config.yml
If it’s invalid graphite-pager will likely crash.
Notifiers
Notifiers are what communicate with your preferred alerting service. Currently Graphite-Pager supports the following notifiers:
HipChat
PagerDuty
PushBullet
Slack
PagerDuty requires an application key set in the environment as PAGERDUTY_KEY
HipChat requires an application key HIPCHAT_KEY and the room to notify HIPCHAT_ROOM
Slack requires an slack SLACK_URL.
PushBullet requires an application key PUSHBULLET_KEY and optionally comma separated list of devices in PUSHBULLET_DEVICES and/or comma separated list of contacts in PUSHBULLET_CONTACTS.
More notifiers are easy to write, file an issue if there is something you would like!
Documentation url
An attribute of docs\_uls in the configuration will add a link to the documentation of the alert. Currently this is in the format of {docs\_url}/{alert name}#{alert legend name}
Alert Format
Alerts have 4 required arguments and 2 optional arguments.
Required arguments:
name - Name of thie alert group
warning - Int for a warning value
critical - Int for a critical value
target - Graphtie metric to check, best if aliased
Graphite Pager understands the values for warning and critical in order to check < and >. If warning is less than critical, values above either will trigger an alert. If warning is greater than critical than lower values will trigger the alert.
Example:
Warning: 1
Critical: 2
0 is fine, 3 will be critical
Warning: 2
Critical: 1
0 is critical, 3 is fine.
Optional argument:
from - The Graphite from parameter for how long to query for ex. -10min default -1min.
exclude - A list of targets to include. This must match the full target so it is recommended that you use the Graphite function alias() to make these readable.
Ordering of Alerts
Alerts with the same name and target will only be checked once! This is useful if you want to have a subset of metrics with different check times and/or values
- name: Load
target: aliasByNode(servers.worker-*.loadavg01,1)
warning: 10
critical: 20
- name: Load
target: aliasByNode(servers.*.loadavg01,1)
warning: 5
critical: 10
In the above example, any worker-* nodes will alert for anything 10 or higher but the catchall will allow for the remaining metrics to be checked without alerting for worker nodes above 5
Metadata
Release files for graphitepager 0.2.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graphitepager-0.2.11.tar.gz | 14.1 kB | Without provenance | Details for graphitepager-0.2.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graphitepager-0.2.11-py2-none-any.whl | Python 2 | none | any | Details for graphitepager-0.2.11-py2-none-any.whl |
Total release size: 32.0 kB
Release files / graphitepager-0.2.11.tar.gz
| Download URL | graphitepager-0.2.11.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d4c27c398b1cc06a67958609d34cb12a369e908dbc26be097ef4efb180e6f6c
|
|
BLAKE2b-256 checksum How to use checksums |
bf68159c49641ec3dd71abccacbe184b99bb9503f32a032285e619a2c1983f54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / graphitepager-0.2.11-py2-none-any.whl
| Download URL | graphitepager-0.2.11-py2-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
7daddf22d3c30564f43b6643a7a86bf534f5dce02729e5a3abaeae3dc098bb5d
|
|
BLAKE2b-256 checksum How to use checksums |
f59426a708d3be4fc6e6dfafccd9b866c231d0c3ac51888a73b2ddad53dfa989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for graphitepager 0.2.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.