Monitoring

To get notifications from the Attini Framework, you can subscribe to the AWS SNS Topic attini-deployment-status.

This topic will get a notification from different stages in an Attini Deployment:

  1. InitDeploy triggered
  2. DeploymentPlan starts
  3. DeploymentPlan ends

All messages will have the following message attributes that can be used for more precise subscriptions:

  • status
  • type
  • environment
  • distributionName

These notifications 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"
}

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 built 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 Framework is built with components that make 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 Attini experiences any operational issues (service limits/errors caused by the underlying AWS Services), you can catch any unexpected failed deployments by Monitoring Attini deployments.

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 an AWS Lambda function called attini-init-deploy is triggered. Some of the tasks that this AWS Lambda function preforms are:

  1. Unpacking the Attini Distribution and puts the content in the attini-artifact-store bucket.
  2. Creating/Updating the InitDeploy CloudFormation Stack.
  3. Populating Attini databases with configuration.
  4. Deleting old Attini Distributions according to your retention configuration.

Most issues that this Lambda can have will be logged by the Attini CLI. However, there are some edge cases that can crash silently, so we recommend 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, for example, the Attini Distribution could be too 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 a 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 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 Attini more than the configuration can handle, if you are using the “[Small]” or “[Medium]” configuration, you can just increase the size one step. If you’re running with the “[Large]{.title-ref}” 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