Coralogix backups

Dashboards, alerts and whatnot should be managed by some form of infrastructure-as-code, and when they are you can easily roll back your changes by applying the right version of the definitions.

When they’re not, though, you can’t easily roll them back, and this can be annoying.

To get around this while learning a bit about the Coralogix API I wrote coralogix-backups, which downloads a team’s dashboards, alerts, events2metrics definitions and parsing rules to local JSON files, one file per thing.

Point it at a git repo and it’ll commit and push each backup, so if you run it from cron you get a history of your config: when that alert threshold changed, or what that dashboard looked like six weeks ago. Things that have been deleted get git rmed, unless you’d rather keep them.

You can restore dashboards and alerts one file at a time. Restoring the rest is on the list, and the README is honest that it’ll happen if somebody shouts.

It’s configured entirely through environment variables, so it’s happy in a cron job or a container. The README has the rest.