Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Grafana 'add annotation' module #141

Open
aorfanos opened this issue Dec 22, 2020 · 2 comments
Open

Create Grafana 'add annotation' module #141

aorfanos opened this issue Dec 22, 2020 · 2 comments

Comments

@aorfanos
Copy link
Contributor

aorfanos commented Dec 22, 2020

SUMMARY

Add a single annotation to Grafana via Ansible, with dynamic variables (e.g. endpoint, dashboard_id's).

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

community.grafana.add_grafana_annotation

ADDITIONAL INFORMATION

I wanted to utilise Grafana annotations for my Ansible deployments, but the callback plugin seemed too limited for my use-case (different Grafana endpoints - various projects/environments and single Ansible repo, different dashboards to be updated by each role etc, which I believe is a common setup for many people).

An 'add annotation' module is more useful for that kind of operation, because it can utilise group_vars or defaults to achieve the desired result.

I have created a sample module at my GitHub, let me know if it needs anything else to be included in community.grafana.

- name: Create a Grafana annotation
  add_grafana_annotation:
    grafana_api_url: "https://grafana.myproject.com"
    grafana_api_key: "..."
    dashboard_id: 468
    panel_id: 20
    text: "Annotation description"
    tags:
      - tag1
      - tag2
@rrey
Copy link
Collaborator

rrey commented Dec 22, 2020

@aorfanos I used to have a module to do that but I’m not sure it is still working : https://github.com/rrey/ansible-module-grafana-annotations
It could be a good reason to add it in the collection and maintain it !

@aorfanos
Copy link
Contributor Author

aorfanos commented Dec 31, 2020

Another small note on that: In my module I implemented 'annotate dashboard by name' functionality, so if we could have the same in the community module it would be amazing :)

Example usage:

- name: Create a Grafana annotation
  add_grafana_annotation:
    grafana_api_url: "https://grafana.myproject.com"
    grafana_api_key: "..."
    dashboard_name: "AlertManager Overview"
    panel_id: 1
    text: "Annotation description"
    tags:
      - tag1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants