All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Utilities: Added Kinesis, S3, CloudWatch Logs, Application Load Balancer, and SES support in
Parser
- Docs: Sidebar menu are now always expanded
- Docs: Broken link to GitHub to homepage
- Utilities: Added support for new EventBridge Replay field in
Parser
andEvent source data classes
- Utilities: Added SNS support in
Parser
- Utilities: Added API Gateway HTTP API data class support for new IAM and Lambda authorizer in
Event source data classes
- Docs: Add new FAQ section for Logger on how to enable debug logging for boto3
- Docs: Add explicit minimal set of permissions required to use Layers provided by Serverless Application Repository (SAR)
- Docs: Fix typo in Dataclasses example for SES when fetching common email headers
- Utilities: Add new
Parser
utility to provide parsing and deep data validation using Pydantic Models - Utilities: Add case insensitive header lookup, and Cognito custom auth triggers to
Event source data classes
- Logger: keeps Lambda root logger handler, and add log filter instead to prevent child log records duplication
- Docs: Improve wording on adding log keys conditionally
- Utilities: Fix issue with boolean values in DynamoDB stream event data class.
- Metrics: Support adding multiple metric values to a single metric name
- Utilities: Add new
Validator
utility to validate inbound events and responses using JSON Schema - Utilities: Add new
Event source data classes
utility to easily describe event schema of popular event sources - Docs: Add new
Testing your code
section to both Logger and Metrics page, and content width is now wider - Tracer: Support for automatically disable Tracer when running a Chalice app
- Docs: Improve wording on log sampling feature in Logger, and removed duplicate content on main page
- Utilities: Remove DeleteMessageBatch API call when there are no messages to delete
- Logger: Add
xray_trace_id
to log output to improve integration with CloudWatch Service Lens - Logger: Allow reordering of logged output
- Utilities: Add new
SQS batch processing
utility to handle partial failures in processing message batches - Utilities: Add typing utility providing static type for lambda context object
- Utilities: Add
transform=auto
in parameters utility to deserialize parameter values based on the key name
- Logger: The value of
json_default
formatter is no longer written to logs
- All: Official Lambda Layer via Serverless Application Repository
- Tracer:
capture_method
andcapture_lambda_handler
now support capture_response=False parameter to prevent Tracer to capture response as metadata to allow customers running Tracer with sensitive workloads
- Metrics: Cold start metric is now completely separate from application metrics dimensions, making it easier and cheaper to visualize.
- This is a breaking change if you were graphing/alerting on both application metrics with the same name to compensate this previous malfunctioning
- Marked as bugfix as this is the intended behaviour since the beginning, as you shouldn't have the same application metric with different dimensions
- Utilities: SSMProvider within Parameters utility now have decrypt and recursive parameters correctly defined to support autocompletion
- Tracer: capture_lambda_handler and capture_method decorators now support
capture_response
parameter to not include function's response as part of tracing metadata
- Tracer: capture_method decorator did not properly handle nested context managers
- Utilities: Add new
parameters
utility to retrieve a single or multiple parameters from SSM Parameter Store, Secrets Manager, DynamoDB, or your very own
- Tracer: capture_method decorator now supports generator functions (including context managers)
- Logger: Logs emitted twice, structured and unstructured, due to Lambda configuring the root handler
- Docs: Clarify confusion on Tracer reuse and
auto_patch=False
statement - Logger: Autocomplete for log statements in PyCharm
- Logger: Regression on
Logger
level not acceptingint
i.e.Logger(level=logging.INFO)
- Logger: Support for logger inheritance with
child
parameter
- Logger: Log level is now case insensitive via params and env var
- Tracer: Correct AWS X-Ray SDK dependency to support 2.5.0 and higher
- Logger: Fix a bug with
inject_lambda_context
causing existing Logger keys to be overridden ifstructure_logs
was called before
- Metrics:
add_metadata
method to add any metric metadata you'd like to ease finding metric related data via CloudWatch Logs - Set status as General Availability
- Imports can now be made from top level of module, e.g.:
from aws_lambda_powertools import Logger, Metrics, Tracer
- Metrics: Fix a bug with Metrics causing an exception to be thrown when logging metrics if dimensions were not explicitly added.
- Metrics: No longer throws exception by default in case no metrics are emitted when using the log_metrics decorator.
- Metrics:
capture_cold_start_metric
parameter added tolog_metrics
decorator - Metrics: Optional
namespace
andservice
parameters added to Metrics constructor to more closely resemble other core utils
- Metrics: Default dimension is now created based on
service
parameter orPOWERTOOLS_SERVICE_NAME
env var
- Metrics:
add_namespace
method deprecated in favor of usingnamespace
parameter to Metrics constructor orPOWERTOOLS_METRICS_NAMESPACE
env var
- Metrics: Coerce non-string dimension values to string
- Logger: Correct
cold_start
,function_memory_size
values from string to bool and int respectively
- Metrics: Fix issue where metrics were not correctly flushed, and cleared on every invocation
- Tracer: Fix Runtime Error for nested sync due to incorrect loop usage
- Tracer: Import aiohttp lazily so it's not a hard dependency
- Tracer: Support for async functions in
Tracer
viacapture_method
decorator - Tracer: Support for
aiohttp
viaaiohttp_trace_config
trace config - Tracer: Support for patching specific modules via
patch_modules
param - Tracer: Document escape hatch mechanisms via
tracer.provider
- Metrics: Fix metric unit casting logic if one passes plain string (value or key)
- Metrics:: Fix
MetricUnit
enum values forBytesPerSecond
KilobytesPerSecond
MegabytesPerSecond
GigabytesPerSecond
TerabytesPerSecond
BitsPerSecond
KilobitsPerSecond
MegabitsPerSecond
GigabitsPerSecond
TerabitsPerSecond
CountPerSecond
- Logger: Introduced
Logger
class for structured logging as a replacement forlogger_setup
- Logger: Introduced
Logger.inject_lambda_context
decorator as a replacement forlogger_inject_lambda_context
- Logger: Raise
DeprecationWarning
exception for bothlogger_setup
,logger_inject_lambda_context
- Middleware factory: Introduced Middleware Factory to build your own middleware via
lambda_handler_decorator
- Metrics: Fixed metrics dimensions not being included correctly in EMF
- Logger: Fix
log_metrics
decorator logic not calling the decorated function, and exception handling
- Metrics: Introduces Metrics middleware to utilise CloudWatch Embedded Metric Format
- Metrics: Added deprecation warning for
log_metrics
- Logger: Introduced log sampling for debug - Thanks to Danilo's contribution
- Public beta release