Monitoring¶
Monitoring Attini deployments¶
To get notifications from the Attini Framework you can subscribe to the AWS SNS Topic attini-deployment-status
.
This topic will get a notifications from different stages in an Attini Deployment:
InitDeploy triggered
DeploymentPlan starts
DeploymentPlan ends
When a CloudFormation stack deployment is triggered
When a CloudFormation stack deployment is finished.
All messages will have the following message attributes that can be used for more precise subscriptions: 1. status 2. type 3. environment 4. distributionName
These notification will be an AWS SNS message with the following structure:
{
"Type" : "Notification",
"MessageId" : "String",
"TopicArn" : "String",
"Message" : "{encoded json sting with attini data}",
"Timestamp" : "yyyy-MM-ddTHH:mm:ss.SSSZ",
"SignatureVersion" : "1",
"Signature" : "String",
"SigningCertURL" : "String",
"UnsubscribeURL" : "String"
}
When encoded json string with attini data
is decoded it will have the structure bellow:
Data from InitDeploy¶
{
"type": "InitDeploy",
"distributionId": "String",
"distributionName": "String",
"initStackName": "String",
"distributionId": "String",
"environment": "String"
"tags": {
"key": "value",
}
}
Data from DeploymentPlan start¶
{
"type": "DeploymentPlanStart",
"deploymentOriginData": {
"distributionTags": {
"key": "value",
},
"distributionId": "String",
"environment": "String",
"deploymentPlanCount": "Number",
"distributionName": "String",
"deploymentSource": {
"deploymentSourcePrefix": "String",
"deploymentSourceBucket": "String"
},
"stackName": "String",
"deploymentName": "String",
"objectIdentifier": "String",
"deploymentTime": "Number"
},
"executionArn": "String",
"region": "String"
}
Data from DeploymentPlan end¶
{
"type": "DeploymentPlanEnd",
"deploymentPlanStepsCount": "Number",
"environment": "String",
"executionArn": "String",
"distributionsName": "String",
"distributionId": "String",
"region": "String",
"status": "SUCCEEDED | FAILED | TIMED_OUT | ABORTED"
}
Data from CloudFormation deployment start and finish¶
{
"type": "DeployCfn",
"environment": "String",
"executionArn": "String",
"distributionsName": "String",
"distributionId": "String",
"eventId": "String",
"stepName": "String",
"stackName": "String",
"region": "String",
"error": "String",
"status": "SUCCEEDED | FAILED | STARTED"
}
Monitoring Attini AWS components¶
Most AWS Resources that Attini is built on have standard metrics which you get for free and you can monitor them however you see fit.
Attini is build on AWS Serverless services so if you want to monitor the Attini components you can find these metrics in the CloudWatch Console.
Most of the Attini is built with components that makes operational issues very unlikely, for example Attini should never reach any capacity limits on S3, SNS or DynamoDB (and if the services have other issues, Attini is configured with retries). If the framework would start to experience any operational issues (service limits/errors caused by the underlying AWS Services), you can catch any unexpected failed deployments by Monitoring Attini deployments.
Recommended monitoring¶
Some service metrics are good to set up alarms for to keep the Attini Framework in shape but this is not required.
Crashing InitDeploy¶
When you preform a deployment a AWS Lambda function called attini-init-deploy
is triggered. Some of the task that this AWS Lambda function preforms is:
Unpacking the Attini Distribution and puts the content in the
attini-artifact-store
bucket.Creating/Updating the InitDeploy CloudFormation Stack.
Populating Attini databases with configuration.
Deleting old Attini Distributions according to your retention configuration.
Most issues that this Lambda can have will be clearly logged by the Attini CLI, however there are som edge cases that can crash silently so we recommended recommended you to monitor the metric:
Namespace: AWS/Lambda
FunctionName: attini-init-deploy
Metric Name: Error
If this metric is ever 1 or higher it means that something is wrong, example the Attini Distribution could be to big or there is a permission
issue somewhere. You can then look in the logs for the attini-init-deploy
or file a support ticket with Attini support.
Lambda Throttles¶
There is always a risk for throttles in systems that are under heavy load. Attini is configured with retires so a few throttling errors should go unnoticed. However, it can make the deployments slower or crash if the load is high enough.
This problem can happen if the Resource allocation in the attini-setup poorly configured.
If the ResourceAllocation
is “Dynamic”, this can be caused by other AWS Lambdas in your AWS Account that is using upp your non reserved concurrency pool.
If the ResourceAllocation
is “Small”, “Medium” or “Large” it means that you are using the Attini more then the configuration can handle, if you are using the
“Small” or “Medium” configuration you can just increase the size to one step. If you running with the “Large” installation and you are experiencing this issue,
please contact Attini support. (ticket will be free of charge)
Namespace: AWS/Lambda
FunctionName: attini-init-deploy
& attini-deployment-plan-setup
& attini-step-guard
& attini-deploy-cfn
Metric Name: Throttles