grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
65.29k stars 12.18k forks source link

Alerting: Improve code organization for database migrations #60195

Open alexweav opened 1 year ago

alexweav commented 1 year ago

We have a large blob of code in the migrations/ualert package. Much of the code is the legacy->unified alerting migration, but not all. There are other unrelated migrations mixed in with that code, and it's not clear where to put new migrations going forward.

We should extract the legacy->unified alert migration into a separate package, with only that code in it. All remaining non-trivial (go-based, not sql-based) migrations should be moved to a one-file-per-migration format.

This is important to prevent old migrations from being accidentally modified and make the code as clear as possible. Migrations tend to stick around for a long time and are very tricky to debug.

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!