Skip to main content

Generate Grafana Annotations from calendar events

Project description

Grafana Calendar Annotator

CII Best Practices

Generate annotations in Grafana from events pulled from an ICS calendar.

Hacktoberfest

This project welcomes Hacktoberfest contributions! Any contributions to increase the OpenSSF Best Practices percentage or that close an issue will be given priority.

Getting Started

CLI

$ grafana-calendar-annotator --help

 Usage: grafana-calendar-annotator [OPTIONS]

╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *  --grafana-url                 -g      TEXT         Url of the Grafana instance to populate annotations into    │
│                                                       [required]                                                  │
│ *  --grafana-api-key             -k      TEXT         API key to authenticate to the Grafana instance [required]  │
│ *  --calendar-url                -c      TEXT         URL of the ICS Calendar to use to populate events from      │
│                                                       [required]                                                  │
│ *  --flatten/--no-flatten        -f/-nf               Flattening events will create a single time annotation      │
│                                                       instead of a span                                           │
│                                                       [default: no-flatten]                                       │
│                                                       [required]                                                  │
│ *  --flatten-direction           -fd     [start|end]  Create the annotation at the start or the end of the event  │
│                                                       if the event is flattened                                   │
│                                                       [default: (start)]                                          │
│                                                       [required]                                                  │
│ *  --tags                        -t      TEXT         List of tags to add to created annotations                  │
│                                                       [default: (generated,)]                                     │
│                                                       [required]                                                  │
│ *  --regenerate/--no-regenerate  -r/-nr               Regenerating will delete all annotations that have the same │
│                                                       set of tags before creating new annotations                 │
│                                                       [default: regenerate]                                       │
│                                                       [required]                                                  │
│    --delete-only                 -d                   Only delete annotations with tags, do not create new        │
│                                                       annotations                                                 │
│    --help                                             Show this message and exit.                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

The following flags can be set with environment variables:

Flag Variable Name
--grafana-url GRAFANA_URL
--grafana-api-key GRAFANA_TOKEN
--flatten FLATTEN
--flatten-direction FLATTEN_DIRECTION
grafana-calendar-annotator --grafana-url https://my-grafana.com --grafana-api-key abcd1234 --flatten --flatten-direction end --calendar-url https://my-calendar.com/personal.ics

# is the same as this

GRAFANA_URL=https://my-grafana.com GRAFANA_TOKEN=abcd1234 FLATTEN=true FLATTEN_DIRECTION=end grafana-calendar-annotator --calendar-url https://my-calendar.com/personal.ics

Installing

Pip

For the library and the cli

pip install grafana_calendar_annotator

Pipx

Pipx is useful for installing and running applications in isolated environments. I've always found it useful to ensure python applications are can be executed from anywhere in your system.

pipx install grafana_calendar_annotator

Running the tests

Deployment

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.

Contributors

Contributors who participated in this project.

License

This project is licensed under the MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grafana-calendar-annotator-0.1.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file grafana-calendar-annotator-0.1.2.tar.gz.

File metadata

  • Download URL: grafana-calendar-annotator-0.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.7 Linux/5.19.13-zen1-1-zen

File hashes

Hashes for grafana-calendar-annotator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 439fa1f82b7687fb5a33ef1616a20e7e0f1660d0155d90f67156df3fa67f4848
MD5 4993fc93c30b331230048e3df293f688
BLAKE2b-256 9812eaea482234e6b654395c72fec87cbc1b4e09d16c57ee4022fb6d44924a74

See more details on using hashes here.

File details

Details for the file grafana_calendar_annotator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for grafana_calendar_annotator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d788d55f42d2cc41f2e569739f1e0e60a055490a1f6d0d1fa684feeec6286e0
MD5 85203542d0684d9fd0e4cbf8511dcc93
BLAKE2b-256 9f627f5aa948fd97dbcb943d3ca4cde63783a89dfbb8dbdde27e85a157763bde

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page