Bedrockifier
Bedrockifier copied to clipboard
Monitoring API
It would be useful to be able to monitor the backup service directly using a tool like Dashy or Homepage. It would also provide a way for docker health checks to directly query the service rather than looking for a state file that the service writes to disk. For example, pulling health information could look like this:
GET http://backup-service/live
RESPONSE: either 200 or 503
{}
GET http://backup-service/status
RESPONSE: 200
{
lastBackup: ‘<lastBackupDate>’,
lastBackupState ‘<success/failed>’,
lastBackupSizes: {
‘yosemite’: 12345,
‘colorado’: 56789
},
lastBackupTotalSize: 69134,
storageTotalUsed: <size of all backups>
}
This could also be potentially used for other things, such as registering for notifications via HTTP callbacks. For example, if I create a container that has a python microservice, part of it’s startup would be to PUT a request to the backup service:
PUT http://backup-service/listen
{
callback: ‘http://python-service/backupEvent’,
events: [‘backup-failed’, ‘backup-complete’]
}
And the callback would look like
POST http://python-service/backupEvent
{
event: ‘backup-complete’
}