Send annotations to Grafana
Project description
grafannotate
A CLI tool to send Grafana annotations to various destinations.
Installation
pip install grafannotate
Usage
grafannotate --help
Usage: grafannotate [OPTIONS]
Send Grafana annotations to various endpoints
Options:
-u, --uri TEXT URI to send annotation to. Default:
"http://localhost:3000/api/annotations".
-k, --api-key TEXT Grafana API key to pass in Authorisation header
-T, --title TEXT Event title. Default: "event".
-t, --tag TEXT Event tags (can be used multiple times).
-d, --description TEXT Event description body. Optional.
-s, --start INTEGER Start timestamp (unix secs). Default: current
timestamp.
-e, --end INTEGER End timestamp (unix secs). Optional.
--help Show this message and exit.
Examples
- Send an annotation to Grafana API for current time
grafannotate --uri http://user:password@grafana:3000/api/annotations --tag my_tag --title "Event Title"
- Send an annotation to Grafana API for a time region
grafannotate --uri http://user:password@grafana:3000/api/annotations --tag my_tag --title "Event Title" --start 1557222057 --end 1557222259
- Send an annotation to Grafana API with an extended description
grafannotate --uri http://user:password@grafana:3000/api/annotations --tag my_tag --title "Event Title" --description "Some longer description<br />with newlines<br />and <a href=\"https://something.com/\">links</a>"
- Pipe output to an annotation description
START_TIME=`date +%s`
command_with_output | grafannotate --uri http://user:password@grafana:3000/api/annotations --tag my_tag --title "Event Title" --start $START_TIME
- Send an annotation to Grafana API using Authorization header
GRAFANA_API_TOKEN="some_generated_api_token"
grafannotate --uri http://grafana:3000/api/annotations --tag my_tag --title "Event Title" --api-key $GRAFANA_API_TOKEN
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
grafannotate-0.3.0.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for grafannotate-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e96d8e8bbfdc7b2f6fcb5ede6856c75cc3c4ea11eb71b9f19e3cd4913fcaffe |
|
MD5 | a3baa851ff193f858a5408c1c051cd49 |
|
BLAKE2b-256 | 9027911dee36ef3aff2890156319549ab271f2e680014e5385587111594091e9 |