Hello, while doing some routine checks on my grafana database i found the annotations table has a relative high amount of entries (100.000 currently). it is not clear to me what the purpose is. as such I want to clean it.
only i thing i can see is that it looks like all alerts ever created are in it. i have no need for that.
suggestions / recommendations or perhaps other users that can confirm the alerts cleanup behavior ?
below sample data of what is in the table:
MariaDB [grafanadb]> select id, org_id, alert_id, user_id, dashboard_id, panel_id, category_id, type, title, metric, prev_state, new_state, data, epoch, region_id, tags, created, updated, epoch_end from annotation order by epoch limit 10;
+----+--------+----------+---------+--------------+----------+-------------+------+-------+--------+------------------+------------------+------+---------------+-----------+------+---------------+---------------+---------------+
| id | org_id | alert_id | user_id | dashboard_id | panel_id | category_id | type | title | metric | prev_state | new_state | data | epoch | region_id | tags | created | updated | epoch_end |
+----+--------+----------+---------+--------------+----------+-------------+------+-------+--------+------------------+------------------+------+---------------+-----------+------+---------------+---------------+---------------+
| 1 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Normal | Pending | | 1659347281320 | 0 | [] | 1659347286332 | 1659347286332 | 1659347281320 |
| 2 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Pending | Alerting | | 1659347581320 | 0 | [] | 1659347581338 | 1659347581338 | 1659347581320 |
| 6 | 2 | 2 | 0 | 0 | 0 | NULL | | | NULL | Normal | Pending (Error) | | 1660021202673 | 0 | [] | 1660021205181 | 1660021205181 | 1660021202673 |
| 9 | 2 | 2 | 0 | 0 | 0 | NULL | | | NULL | Pending (Error) | Alerting (Error) | | 1660021802673 | 0 | [] | 1660021810181 | 1660021810181 | 1660021802673 |
| 10 | 2 | 2 | 0 | 0 | 0 | NULL | | | NULL | Alerting (Error) | Normal | | 1660022402673 | 0 | [] | 1660022405182 | 1660022405182 | 1660022402673 |
| 14 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Alerting | Normal | | 1660549862519 | 0 | [] | 1660549862530 | 1660549862530 | 1660549862519 |
| 15 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Normal | Pending | | 1660550282519 | 0 | [] | 1660550287531 | 1660550287531 | 1660550282519 |
| 16 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Pending | Alerting | | 1660550582519 | 0 | [] | 1660550587531 | 1660550587531 | 1660550582519 |
| 17 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Alerting | Normal | | 1660596602519 | 0 | [] | 1660596605032 | 1660596605032 | 1660596602519 |
| 18 | 2 | 4 | 0 | 0 | 0 | NULL | | | NULL | Normal | Pending | | 1660597622519 | 0 | [] | 1660597627531 | 1660597627531 | 1660597622519 |
+----+--------+----------+---------+--------------+----------+-------------+------+-------+--------+------------------+------------------+------+---------------+-----------+------+---------------+---------------+---------------+
some info on my setup:
- latest 9.5
- docker
- i use mariadb10.11 and migrated to it using GitHub - grafana/database-migrator: Code to export grafana.db (sqlite) to MySQL-compatible SQL file, to assist in migration of Grafana data to MySQL-compatible DB.