Skip to content
Snippets Groups Projects
dashboard.json.tpl 5.47 KiB
{
    "widgets": [
        {
            "height": 3,
            "width": 24,
            "y": 0,
            "x": 0,
            "type": "text",
            "properties": {
                "markdown": "\n# API Gateway\n - [${apigw_name}/${apigw_stage_name}](https://${aws_region}.console.aws.amazon.com/apigateway/home?region=${aws_region}#/apis/${api_id}/stages/${apigw_stage_name})\n"
            }
        },
        {
            "height": 3,
            "width": 24,
            "y": 9,
            "x": 0,
            "type": "text",
            "properties": {
                "markdown": "\n# Lambdas \n%{for l in lambda_names} - [${l}](https://${aws_region}.console.aws.amazon.com/lambda/home?region=${aws_region}#/functions/${l}?tab=monitoring)\n%{endfor}\n"
            }
        },
        {
            "height": 3,
            "width": 24,
            "y": 23,
            "x": 0,
            "type": "text",
            "properties": {
                "markdown": "\n# DynamoDB\n - [${dynamodb_table_name}](https://${aws_region}.console.aws.amazon.com/dynamodb/home?region=${aws_region}#tables:selected=${dynamodb_table_name};tab=overview)\n"
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 3,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "100*(m1/m3)", "label": "Proportion of 5XX errors", "id": "e1", "region": "${aws_region}" } ],
                    [ { "expression": "100*(m2/m3)", "label": "Proportion of 4XX errors", "id": "e2", "region": "${aws_region}" } ],
                    [ "AWS/ApiGateway", "5XXError", "ApiName", "${apigw_name}", "Stage", "${apigw_stage_name}", { "id": "m1", "visible": false } ],
                    [ "AWS/ApiGateway", "4XXError", "ApiName", "${apigw_name}", "Stage", "${apigw_stage_name}", { "id": "m2", "visible": false } ],
                    [ ".", "Count", ".", ".", ".", ".", { "id": "m3", "visible": false } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "${aws_region}",
                "period": 60,
                "title": "Request Errors",
                "stat": "Sum"
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 3,
            "x": 12,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": [
                    [ "AWS/ApiGateway", "Count", "ApiName", "${apigw_name}", "Stage", "${apigw_stage_name}" ]
                ],
                "region": "${aws_region}",
                "title":"Number of requests",
                "period": 60,
                "stat":"Sum"
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 12,
            "x": 0,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": ${jsonencode(
                    [
                        for name in lambda_names : ["AWS/Lambda", "Throttles", "FunctionName", "${name}"]
                    ])
                },
                "region": "${aws_region}",
                "period": 60
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 12,
            "x": 12,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": ${jsonencode(
                    [
                        for name in lambda_names : ["AWS/Lambda", "Invocations", "FunctionName", "${name}"]
                    ])
                },
                "region": "${aws_region}",
                "period": 60
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 18,
            "x": 0,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": ${jsonencode(
                    [
                        for name in lambda_names : ["LambdaInsights", "memory_utilization", "function_name", "${name}"]
                    ])
                },
                "region": "${aws_region}",
                "period":60
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 27,
            "x": 0,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": [
                    [ "AWS/DynamoDB", "ConsumedWriteCapacityUnits", "TableName", "${dynamodb_table_name}" ],
                    [ ".", "ProvisionedWriteCapacityUnits", ".", "." ]
                ],
                "region": "${aws_region}",
                "period":60
            }
        },
        {
            "height": 6,
            "width": 12,
            "y": 27,
            "x": 12,
            "type": "metric",
            "properties": {
                "view": "timeSeries",
                "stacked": false,
                "metrics": [
                    [ "AWS/DynamoDB", "ConsumedReadCapacityUnits", "TableName", "${dynamodb_table_name}" ],
                    [ ".", "ProvisionedWriteCapacityUnits", ".", "." ]
                ],
                "region": "${aws_region}",
                "period": 60
            }
        }
    ]
}