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: 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
Validatorutility to validate inbound events and responses using JSON Schema - Utilities: Add new
Event source data classesutility to easily describe event schema of popular event sources - Docs: Add new
Testing your codesection 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_idto log output to improve integration with CloudWatch Service Lens - Logger: Allow reordering of logged output
- Utilities: Add new
SQS batch processingutility to handle partial failures in processing message batches - Utilities: Add typing utility providing static type for lambda context object
- Utilities: Add
transform=autoin parameters utility to deserialize parameter values based on the key name
- Logger: The value of
json_defaultformatter is no longer written to logs
- All: Official Lambda Layer via Serverless Application Repository
- Tracer:
capture_methodandcapture_lambda_handlernow 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_responseparameter 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
parametersutility 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=Falsestatement - Logger: Autocomplete for log statements in PyCharm
- Logger: Regression on
Loggerlevel not acceptinginti.e.Logger(level=logging.INFO)
- Logger: Support for logger inheritance with
childparameter
- 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_contextcausing existing Logger keys to be overridden ifstructure_logswas called before
- Metrics:
add_metadatamethod 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_metricparameter added tolog_metricsdecorator - Metrics: Optional
namespaceandserviceparameters added to Metrics constructor to more closely resemble other core utils
- Metrics: Default dimension is now created based on
serviceparameter orPOWERTOOLS_SERVICE_NAMEenv var
- Metrics:
add_namespacemethod deprecated in favor of usingnamespaceparameter to Metrics constructor orPOWERTOOLS_METRICS_NAMESPACEenv var
- Metrics: Coerce non-string dimension values to string
- Logger: Correct
cold_start,function_memory_sizevalues 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
Tracerviacapture_methoddecorator - Tracer: Support for
aiohttpviaaiohttp_trace_configtrace config - Tracer: Support for patching specific modules via
patch_modulesparam - Tracer: Document escape hatch mechanisms via
tracer.provider
- Metrics: Fix metric unit casting logic if one passes plain string (value or key)
- Metrics:: Fix
MetricUnitenum values forBytesPerSecondKilobytesPerSecondMegabytesPerSecondGigabytesPerSecondTerabytesPerSecondBitsPerSecondKilobitsPerSecondMegabitsPerSecondGigabitsPerSecondTerabitsPerSecondCountPerSecond
- Logger: Introduced
Loggerclass for structured logging as a replacement forlogger_setup - Logger: Introduced
Logger.inject_lambda_contextdecorator as a replacement forlogger_inject_lambda_context
- Logger: Raise
DeprecationWarningexception 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_metricsdecorator 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