I have open sourced my monitoring solution that I use for AlgoTerminal live trading. Though the logger is written in C#, any logger in any language will work as long as it logs structured events (JSON) and has the following properties that my logger has:
StrategyId, EventType and EventSubType.
This solution can work for both AWS cloud hosting, on-premise or any other hosting provider. Here is how it works.
1. Both strategy execution and health check events are logged to disk and then posted to AWS CloudWatch. Also, the ATS (Automated Trading System) log file is also posted to CloudWatch.
2. AWS CloudWatch Alarms are setup for health check events (must be a certain number of events per duration of time) and the ATS log stream (alarm is triggered if an error is encountered). If the alarm is triggered, a Lambda function posts the alarm to Slack.
3. Each strategy can have its own Slack channel and we can filter exactly what kind of events go to the Slack channel.
Below are the repos for the logger and the AWS Lambda functions for sending log events to Slack.
https://github.com/fasterquant
Here is a lambda for sending the alarms to Slack.
https://github.com/blueimp/aws-lambda/tree/master/cloudwatch-alarm-to-slack
Sorry I don't have more information on setting this all up. I plan on writing some blog articles but there are many pieces in AWS an I have not had the time to document them all and get them in a presentable format.
Below is my Slack account. All strategy events are are going to one channel but I have since implemented the ability for each strategy to have its own channel.
StrategyId, EventType and EventSubType.
This solution can work for both AWS cloud hosting, on-premise or any other hosting provider. Here is how it works.
1. Both strategy execution and health check events are logged to disk and then posted to AWS CloudWatch. Also, the ATS (Automated Trading System) log file is also posted to CloudWatch.
2. AWS CloudWatch Alarms are setup for health check events (must be a certain number of events per duration of time) and the ATS log stream (alarm is triggered if an error is encountered). If the alarm is triggered, a Lambda function posts the alarm to Slack.
3. Each strategy can have its own Slack channel and we can filter exactly what kind of events go to the Slack channel.
Below are the repos for the logger and the AWS Lambda functions for sending log events to Slack.
https://github.com/fasterquant
Here is a lambda for sending the alarms to Slack.
https://github.com/blueimp/aws-lambda/tree/master/cloudwatch-alarm-to-slack
Sorry I don't have more information on setting this all up. I plan on writing some blog articles but there are many pieces in AWS an I have not had the time to document them all and get them in a presentable format.
Below is my Slack account. All strategy events are are going to one channel but I have since implemented the ability for each strategy to have its own channel.