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.
- Logger: Fix a bug with
inject_lambda_context
causing existing an Logger keys to be overriden 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 stuctured 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