Do not use this library in production
AWS Lambda Powertools for TypeScript is currently released as a beta developer preview and is intended strictly for feedback purposes only.
This version is not stable, and significant breaking changes might incur as part of the upcoming production-ready release.
Do not use this library for production workloads.
AWS Lambda Powertools for TypeScript provides a suite of utilities for AWS Lambda functions running on the Node.js runtime, to ease the adoption of best practices such as tracing, structured logging, custom metrics, and more.
Core utilities such as Tracer, Logger, Metrics, and Event Handler will be available across all Lambda Powertools runtimes. Additional utilities are subjective to each language ecosystem and customer demand.
- AWS Lambda only. We optimise for AWS Lambda function environments and supported runtimes only. Utilities might work with web frameworks and non-Lambda environments, though they are not officially supported.
- Eases the adoption of best practices. The main priority of the utilities is to facilitate best practices adoption, as defined in the AWS Well-Architected Serverless Lens; all other functionality is optional.
- Keep it lean. Additional dependencies are carefully considered for security and ease of maintenance, and prevent negatively impacting startup time.
- We strive for backwards compatibility. New features and changes should keep backwards compatibility. If a breaking change cannot be avoided, the deprecation and migration process should be clearly defined.
- We work backwards from the community. We aim to strike a balance of what would work best for 80% of customers. Emerging practices are considered and discussed via Requests for Comment (RFCs)
- Progressive. Utilities are designed to be incrementally adoptable for customers at any stage of their Serverless journey. They follow language idioms and their community’s common practices.
|Tracer||Utilities to trace Lambda function handlers, and both synchronous and asynchronous functions|
|Logger||Structured logging made easier, and a middleware to enrich log items with key details of the Lambda context|
|Metrics||Custom Metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)|
Explicit parameters passed in constructors or in middleware/decorators take precedence over environment variables.
|POWERTOOLS_SERVICE_NAME||Sets service name used for tracing namespace, metrics dimension and structured logging||All||
|POWERTOOLS_METRICS_NAMESPACE||Sets namespace used for metrics||Metrics||
|POWERTOOLS_TRACE_ENABLED||Explicitly disables tracing||Tracer||
|POWERTOOLS_TRACER_CAPTURE_RESPONSE||Captures Lambda or method return as metadata.||Tracer||
|POWERTOOLS_TRACER_CAPTURE_ERROR||Captures Lambda or method exception as metadata.||Tracer||
|POWERTOOLS_TRACER_CAPTURE_HTTPS_REQUESTS||Captures HTTP(s) requests as segments.||Tracer||
|POWERTOOLS_LOGGER_LOG_EVENT||Logs incoming event||Logger||
|POWERTOOLS_LOGGER_SAMPLE_RATE||Debug log sampling||Logger||
|POWERTOOLS_LOGGER_LOG_EVENT||Logs incoming events||Logger||
|LOG_LEVEL||Sets logging level||Logger||
- AWS Developers Slack:
#lambda-powertools- Invite, if you don't have an account
- Email: firstname.lastname@example.org