Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acornies/faas-grafana-annotate
An OpenFaaS function to create annotations in Grafana (>= v4.6).
https://github.com/acornies/faas-grafana-annotate
grafana grafana-annotations openfaas openfaas-function serverless
Last synced: about 2 months ago
JSON representation
An OpenFaaS function to create annotations in Grafana (>= v4.6).
- Host: GitHub
- URL: https://github.com/acornies/faas-grafana-annotate
- Owner: acornies
- Created: 2018-09-28T17:56:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T18:06:44.000Z (over 4 years ago)
- Last Synced: 2024-07-27T04:37:07.398Z (5 months ago)
- Topics: grafana, grafana-annotations, openfaas, openfaas-function, serverless
- Language: Go
- Homepage:
- Size: 335 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# faas-grafana-annotate
An OpenFaaS function to create annotations in Grafana (>= v4.6).Install faas-cli
```bash
curl -sSL https://cli.openfaas.com | sudo sh
```## Supported Request Parameters
- body (string, text/plain)
- query string
- tag (string, multiple, optional)
- panelId (int, optional)
- dashboardId (int, optional)By default, if no tags are provided, the tag "global" is used for your annotation. In your dashboard, make sure *Annotations & Alerts* is enabled and filtered by the appropriate tag.
## Function Configuration
- environment
- grafana_url
- secrets
- grafana-api-token
- grafana-username
- grafana-passwordThis function prioritizes **grafana-api-token** first, then falls back to basic authentication provided by grafana-username and grafana-password.
### Grafana Configuration
1) Add new API key (User icon -> API Keys) w/ Editor role
2) In your dashboard, click gear icon -> Annotations -> enable
> In your dashboard, make sure *Annotations & Alerts* is enabled and and filtered by the appropriate tag.## Deployment Examples
faas-cli (from Docker)
```bash
faas-cli deploy --image acornies/grafana-annotate --env grafana_url=http://example:3000
```
faas-cli (from source)
```bash
faas-cli deploy -f ./grafana-annotate.yml --env grafana_url=http://example:3000
```## Invoke Examples
faas-cli
```bash
faas-cli invoke grafana-annotate --query tag=global --query tag=faas --query dashboardId=1 --query panelId=1 --gateway http://localhost:8080
```
curl
```bash
curl -XPOST -d 'test annotation' "http://localhost:8080/function/grafana-annotate?tag=global&tag=faas&tag=application"
```
## Screenshot Example
![faas grafana screenshot](https://github.com/tucows/faas-grafana-annotate/blob/master/grafana_screen.png)