Comprehensive developer toolkit implementing serverless best practices for AWS Lambda functions in Python
89
{
"context": "This criteria evaluates how well the engineer uses AWS Lambda Powertools Metrics module to emit custom CloudWatch metrics with proper dimensions and metadata. The focus is on correctly distinguishing between dimensions (for aggregation/filtering) and metadata (for detailed investigation), using appropriate metric units, and properly configuring the metrics namespace and service.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Metrics Module Import",
"description": "Correctly imports the Metrics class from aws_lambda_powertools.metrics",
"max_score": 5
},
{
"name": "Metrics Initialization",
"description": "Initializes Metrics instance with namespace='EcommerceMetrics' and service='OrderProcessing'",
"max_score": 10
},
{
"name": "Dimension Addition",
"description": "Uses add_dimension() or similar method to add all three required dimensions: Region, ProductCategory, and PaymentMethod with correct values from the event",
"max_score": 25
},
{
"name": "Metadata Addition",
"description": "Uses add_metadata() or similar method to add all three required metadata fields: CustomerSegment, PromotionCode, and WarehouseLocation (NOT as dimensions)",
"max_score": 25
},
{
"name": "OrderValue Metric",
"description": "Uses add_metric() to emit OrderValue metric with the correct value from the event and appropriate unit (e.g., None for currency or Count)",
"max_score": 10
},
{
"name": "OrderQuantity Metric",
"description": "Uses add_metric() to emit OrderQuantity metric with the correct value from the event and unit=MetricUnit.Count",
"max_score": 10
},
{
"name": "Metric Publishing",
"description": "Uses @metrics.log_metrics decorator or equivalent mechanism to ensure metrics are published at function completion",
"max_score": 10
},
{
"name": "MetricUnit Usage",
"description": "Correctly imports and uses MetricUnit enum from aws_lambda_powertools.metrics for specifying metric units (e.g., MetricUnit.Count)",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/pypi-aws-lambda-powertoolsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10