This project provides a simple means for capturing your DataDog dashboards and monitors as JSON and storing them in a git repository. It will also create a DataDog event on success or failure. If run regularly it can help provide a change history (minus authors) for DataDog objects.
To use this project:
If you wish to name a different config file you can specify an alternate using --config file.json
. It is assumed to be the base directory.
That's all. Dashboards and monitors will be retrieved and committed to the git repo that you specified in the config file.
To run this project with PM2 to ensure it stays up just run:
By default if you run this project you will get a one time backup. However, if you wish to have this backup task continue to run on a regular basis then you can specify a valid cron interval value under backupInterval in your config file. For example, to run every 10 minutes you would add:
"backupInterval": "*/10 * * * *"
The interpretation of the interval will be logged out (debug level only) for you to validate. In this case it would look like this:
[{"s":[0],"m":[0,10,20,30,40,50]}]
These env vars can be used.