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.2.0.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grafannotate-0.2.0.tar.gz.
File metadata
- Download URL: grafannotate-0.2.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73d98bf3821f07bc507c92c1128f2b72fbeb9991143ed9f9f6a9ce81b04b99aa
|
|
| MD5 |
c124f00ae6bc3f8621a16413bcb4cf6d
|
|
| BLAKE2b-256 |
24eae0f45dd4739365dc615c79a67e89cf96796cbf7b58ddf0eb57fab0a77853
|
File details
Details for the file grafannotate-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: grafannotate-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
335e8146a2226ae0db36cfd748c4424ad406821c394bc46cfc0db9dc12a25e13
|
|
| MD5 |
65f09d1f4cd916f5392d1f98055bf495
|
|
| BLAKE2b-256 |
a4d16972f3e3ba31117ef76b0acc4d8580a4cf45368aaceb4dfa5b3689ba01b2
|