Skip to main content

grafannotate

Build Status Coverage Status PyPI version

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

Release files for grafannotate 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grafannotate 0.3.0
File Size Uploaded
grafannotate-0.3.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grafannotate 0.3.0
File Interpreter ABI Platform
grafannotate-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 10.1 kB

Release files / grafannotate-0.3.0.tar.gz

Download URL grafannotate-0.3.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1cc1b035c6d714518019b04b31d8252a18694c8808928d3527a8c61f128e7308
BLAKE2b-256 checksum
How to use checksums
6f27dc0daab5f1c844aa180dab644320edca257c29f8f17a9f60396a173fcaab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7

Release files / grafannotate-0.3.0-py2.py3-none-any.whl

Download URL grafannotate-0.3.0-py2.py3-none-any.whl
Size 5.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6e96d8e8bbfdc7b2f6fcb5ede6856c75cc3c4ea11eb71b9f19e3cd4913fcaffe
BLAKE2b-256 checksum
How to use checksums
9027911dee36ef3aff2890156319549ab271f2e680014e5385587111594091e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page