Summary
In this release, we are thrilled to announce new features and improvements:
- Customizable masking capabilities with the erase method in Data Masking utility
- Ability to disable metrics flush via environment variables
- New Event Source Data Classes for API Gateway Authorizer Response WebSocket
- New method to the Logger class to clear appended keys at any point during the execution of your Lambda invocation
Special thanks to @philiptzou, for improving type annotations in our OpenAPI utility! ⭐
Custom masking support for Data Masking
You can now configure advanced masking options when using erase
method in the Data Masking utility. This feature provides granular control to protect sensitive information while maintaining data readability and structure.
The new options to use with erase
:
- Dynamic Mask: Preserves text length and structure by replacing characters with
*
- Custom Mask: Apply simple pattern like "XX-XX"
- Regex Mask: Advanced pattern-based masking for complex data formats
- Field-specific Allows different masking rules for different data fields
Disable flushing metrics using environment variables
You can now set the POWERTOOLS_METRICS_DISABLES
environment variable to control the metrics output. This is useful when you want to silent metrics in a non-production environment. When POWERTOOLS_DEV
is enabled, the metrics are also suppressed, but you can always override it by setting POWERTOOLS_METRICS_DISABLED=false
when you want to continue emitting metrics while in dev mode.
Support for API Gateway Authorizer Response WebSocket
You can now use the new APIGatewayAuthorizerResponseWebSocket
class to handle authorization policies for WebSocket APIs.
Clearing all appended keys with clear_state()
method
We have added a new clear_state()
to Logger to easily remove any temporary keys you have added. This is useful when you add multiple custom keys conditionally or when you emit canonical or wide logs.
Changes
- refactor(metrics): Improve type annotations for metrics decorator (#6000) by @leandrodamascena
🌟New features and non-breaking changes
- feat(data-masking): add custom mask functionalities (#5837) by @anafalcao
- feat(metrics): disable metrics flush via environment variables (#6046) by @anafalcao
- feat(event_source): add class APIGatewayAuthorizerResponseWebSocket (#6058) by @leandrodamascena
- feat(openapi): enhance support for tuple return type validation (#5997) by @philiptzou
- feat(logger): add clear_state method (#5956) by @anafalcao
📜 Documentation updates
- docs(api): migrating the event handler utility to mkdocstrings (#6023) by @leandrodamascena
- docs(api): migrating the metrics utility to mkdocstrings (#6022) by @leandrodamascena
- docs(api): migrating the logger utility to mkdocstrings (#6021) by @leandrodamascena
- docs(api): migrating the Middleware Factory utility to mkdocstrings (#6019) by @leandrodamascena
- docs(api): migrating the tracer utility to mkdocstrings (#6017) by @leandrodamascena
- docs(api): migrating the batch utility to mkdocstrings (#6016) by @leandrodamascena
- docs(api): migrating the event source data classes utility to mkdocstrings (#6015) by @leandrodamascena
- docs(api): migrating the data masking utility to mkdocstrings (#6013) by @leandrodamascena
- docs(api): migrating the AppConfig utility to mkdocstrings (#6008) by @leandrodamascena
- docs(api): migrating the idempotency utility to mkdocstrings (#6007) by @leandrodamascena
- docs(api): migrating the jmespath utility to mkdocstrings (#6006) by @leandrodamascena
- docs(api): migrating the parameters utility to mkdocstrings (#6005) by @leandrodamascena
- docs(api): migrating the parser utility to mkdocstrings (#6004) by @leandrodamascena
- docs(api): migrating the streaming utility to mkdocstrings (#6003) by @leandrodamascena
- docs(api): migrating the typing utility to mkdocstrings (#5996) by @leandrodamascena
- docs(api): migrating the validation utility to mkdocstrings (#5972) by @leandrodamascena
- docs(layer): update layer version number - v3.5.0 (#5952) by @leandrodamascena
🐛 Bug and hot fixes
- fix(logger): child logger must respect log level (#5950) by @leandrodamascena
- fix(docs): typo in a service name in Event Handler (#5944) by @anafalcao
🔧 Maintenance
- chore(deps-dev): bump ruff from 0.9.5 to 0.9.6 (#6066) by @dependabot[bot]
- chore(deps-dev): bump coverage from 7.6.10 to 7.6.11 (#6067) by @dependabot[bot]
- chore(deps-dev): bump mkdocs-material from 9.6.2 to 9.6.3 (#6065) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.20 to 3.0.21 (#6064) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.36.14 to 1.36.16 (#6057) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
7e841df
toc62453b
in /docs (#6052) by @dependabot[bot] - chore(deps-dev): bump mkdocstrings-python from 1.14.5 to 1.14.6 (#6050) by @dependabot[bot]
- chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.291 to 0.1.292 (#6051) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.36.14 to 1.36.15 (#6049) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.178.0a0 to 2.178.1a0 (#6048) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-lib from 2.178.0 to 2.178.1 (#6047) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.178.0 to 2.178.1 (#6053) by @dependabot[bot]
- chore(deps): bump docker/setup-qemu-action from 3.3.0 to 3.4.0 (#6043) by @dependabot[bot]
- chore(deps): bump docker/setup-buildx-action from 3.8.0 to 3.9.0 (#6042) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk from 2.177.0 to 2.178.0 (#6040) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-aws-lambda-python-alpha from 2.177.0a0 to 2.178.0a0 (#6041) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.9.4 to 0.9.5 (#6039) by @dependabot[bot]
- chore(deps-dev): bump aws-cdk-lib from 2.177.0 to 2.178.0 (#6038) by @dependabot[bot]
- chore(docs): enable privacy plugin in docs (#6036) by @dreamorosi
- chore(deps-dev): bump mypy from 1.14.1 to 1.15.0 (#6028) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.36.12 to 1.36.14 (#6029) by @dependabot[bot]
- chore(deps-dev): bump cdklabs-generative-ai-cdk-constructs from 0.1.290 to 0.1.291 (#6031) by @dependabot[bot]
- chore(deps-dev): bump cfn-lint from 1.23.1 to 1.24.0 (#6030) by @dependabot[bot]
- chore(deps-dev): bump mkdocstrings-python from 1.14.4 to 1.14.5 (#6032) by @dependabot[bot]
- chore(ci): add new script to bump Lambda layer version (#6001) by @leandrodamascena
- chore(deps-dev): bump mkdocstrings-python from 1.14.2 to 1.14.4 (#6025) by @dependabot[bot]
- chore(ci): remove pdoc3 library (#6024) by @leandrodamascena
- chore(deps-dev): bump boto3-stubs from 1.36.10 to 1.36.12 (#6014) by @dependabot[bot]
- chore(deps-dev): bump boto3-stubs from 1.36.10 to 1.36.11 (#6010) by @dependabot[bot]
- chore(deps-dev): bump mkdocs-material from 9.6.1 to 9.6.2 (#6009) by @dependabot[bot]
- chore(deps-dev): bump mkdocstrings-python from 1.13.0 to 1.14.2 (#6011) by @dependabot[bot]
- chore(deps): bump squidfunk/mkdocs-material from
471695f
to7e841df
in /docs (#6012) by @dependabot[bot] - chore(deps): bump squidfunk/mkdocs-material from
41942f7
to471695f
in /docs (#5979) by @dependabot[bot] - chore(deps): bump actions/setup-go from 5.2.0 to 5.3.0 (#5978) by @dependabot[bot]
- chore(deps): bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 (#5980) by @dependabot[bot]
- chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 3.0.18 to 3.0.20 (#5977) by @dependabot[bot]
- chore(deps): bump release-drafter/release-drafter from 6.0.0 to 6.1.0 (#5976) by @dependabot[bot]
- chore(deps): bump aws-actions/configure-aws-credentials from 4.0.2 to 4.0.3 (#5975) by @dependabot[bot]
- chore(deps-dev): bump black from 24.10.0 to 25.1.0 (#5968) by @dependabot[bot]
- chore(deps-dev): bump ruff from 0.9.3 to 0.9.4 (#5969) by @dependabot[bot]
- chore(deps-dev): bump cfn-lint from 1.22.7 to 1.23.1 (#5967) by @dependabot[bot]
- chore(deps-dev): bump isort from 5.13.2 to 6.0.0 (#5965) by @dependabot[bot]
- chore(deps): bump actions/upload-artifact from 4.5.0 to 4.6.0 (#5962) by @dependabot[bot]
- chore(deps): bump actions/setup-node from 4.1.0 to 4.2.0 (#5963) by @dependabot[bot]
- chore(deps-dev): bump mkdocs-material from 9.5.50 to 9.6.1 (#5966) by @dependabot[bot]
- chore(deps): bump codecov/codecov-action from 5.1.2 to 5.3.1 (#5964) by @dependabot[bot]
- chore(deps): bump docker/setup-qemu-action from 3.2.0 to 3.3.0 (#5961) by @dependabot[bot]
- chore(ci): install & configure mkdocstrings plugin (#5959) by @leandrodamascena
- chore(deps): bump actions/setup-python from 5.3.0 to 5.4.0 (#5960) by @dependabot[bot]
This release was made possible by the following contributors:
@anafalcao, @dependabot[bot], @dreamorosi, @github-actions[bot], @leandrodamascena, @philiptzou, dependabot[bot] and github-actions[bot]