Download Latest Version v2.33.0 source code.tar.gz (2.6 MB)
Email in envelope

Get an email when there's a new version of AWS Powertools for Lambda

Home / v2.33.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-04-14 8.9 kB
v2.33.0 source code.tar.gz 2026-04-14 2.6 MB
v2.33.0 source code.zip 2026-04-14 3.3 MB
Totals: 3 Items   5.8 MB 2

Summary

In this release, the HTTP event handler gains a new metrics middleware that lets you emit per-request latency, fault, and error metrics with a single line of configuration. The middleware automatically uses the matched route as a dimension and attaches request metadata like HTTP method, path, status code, and API Gateway request IDs.

We've also improved the parser package by exporting InferOutput from the public types entry point, resolving a TypeScript declaration emit error (TS2883) that affected consumers using safeParse mode — particularly those upgrading to TypeScript 6.

⭐ Congratulations to @yashar-new10 and @faberchri for their first PR merged in the project 🎉

Metrics Middleware

You can now use the Metrics utility with the HTTP event handler to automatically emit CloudWatch metrics for every request. The middleware:

  • Adds the matched route as a metric dimension (e.g., GET /users/:id)
  • Emits latency (Milliseconds), fault (Count), and error (Count) metrics
  • Attaches request metadata including httpMethod, path, statusCode, userAgent, and ipAddress
  • Adds API Gateway-specific metadata (apiGwRequestId, apiGwApiId) when available
  • Uses NOT_FOUND as the route dimension when no route matches, preventing dimension explosion

    :::typescript import { Router } from '@aws-lambda-powertools/event-handler/http'; import { metrics as metricsMiddleware } from '@aws-lambda-powertools/event-handler/http/middleware/metrics'; import { Metrics } from '@aws-lambda-powertools/metrics; import type { Context } from 'aws-lambda';

    const metrics = new Metrics({ namespace: 'my-app', serviceName: 'my-service' }); const app = new Router();

    app.use(metricsMiddleware(metrics));

    app.get('/users/:id', async ({ params }) => { return { id: params.id, name: 'Jane' }; });

    export const handler = async (event: unknown, context: Context) => app.resolve(event, context);

    Changes

  • improv(parser): export InferOutput from public types entry point (#5175) by @yashar-new10

  • chore(deps): add esbuild as explicit devDependency (#5173) by @sdangol
  • chore: temporarily remove Bahrain (me-south-1) region from layer publishing (#5169) by @svozza
  • docs(commons): fix isStrictEqual and areArraysEqual JSDoc array comparison description (#5165) by @Zelys-DFKH
  • docs: fix dependencies & broken references (#5156) by @dreamorosi
  • docs: fix markdown table format (#5153) by @dothomson
  • style: remove useAwait linting rule (#5146) by @dreamorosi
  • docs(event-handler): update custom middleware example to use Store API (#5145) by @svozza
  • fix(commons): don't overwrite existing value with undefined in deepMerge (#5141) by @faberchri
  • fix(event-handler): http response body validation typings (#5125) by @nateiler
  • feat(event-handler): add metrics middleware for HTTP routes (#5086) by @svozza
  • fix: update middy types to be aligned with 7.1.2 update (#5100) by @willfarrell
  • fix(commons): rename AvailabilityZoneId to AvailabilityZoneID in docs and tests (#5118) by @svozza

🔧 Maintenance

  • chore(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1 (#5181) by @dependabot[bot]
  • chore(deps-dev): bump typedoc from 0.28.18 to 0.28.19 in the typescript group across 1 directory (#5182) by @dependabot[bot]
  • chore(deps): bump actions/github-script from 8.0.0 to 9.0.0 (#5177) by @dependabot[bot]
  • chore(deps): bump release-drafter/release-drafter from 7.1.1 to 7.2.0 (#5178) by @dependabot[bot]
  • chore(deps-dev): bump @biomejs/biome from 2.4.10 to 2.4.11 (#5179) by @dependabot[bot]
  • chore(deps): bump @types/node from 25.5.2 to 25.6.0 (#5180) by @dependabot[bot]
  • chore(deps): bump aws-actions/configure-aws-credentials from 6.0.0 to 6.1.0 (#5170) by @dependabot[bot]
  • chore(deps-dev): bump the vitest group across 1 directory with 2 updates (#5176) by @dependabot[bot]
  • chore(deps-dev): bump the vitest group across 1 directory with 2 updates (#5171) by @dependabot[bot]
  • chore(deps-dev): bump protobufjs from 8.0.0 to 8.0.1 (#5164) by @dependabot[bot]
  • chore(deps-dev): bump typedoc-plugin-missing-exports from 4.1.2 to 4.1.3 in the typescript group across 1 directory (#5163) by @dependabot[bot]
  • chore(deps): bump @types/node from 25.5.0 to 25.5.2 (#5161) by @dependabot[bot]
  • chore(deps): bump esbuild from 0.27.5 to 0.28.0 (#5160) by @dependabot[bot]
  • chore(deps): bump esbuild from 0.27.4 to 0.27.5 (#5159) by @dependabot[bot]
  • chore(deps-dev): bump @valkey/valkey-glide from 2.3.0 to 2.3.1 (#5158) by @dependabot[bot]
  • chore(deps-dev): bump @biomejs/biome from 2.4.9 to 2.4.10 (#5152) by @dependabot[bot]
  • chore(deps): bump pygments from 2.18.0 to 2.20.0 in /docs (#5150) by @dependabot[bot]
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 5.0.3 to 5.0.4 (#5149) by @dependabot[bot]
  • chore(deps): bump actions/setup-go from 6.3.0 to 6.4.0 (#5148) by @dependabot[bot]
  • chore(deps): bump github/codeql-action from 4.35.0 to 4.35.1 (#5147) by @dependabot[bot]
  • chore(deps-dev): bump the vitest group across 1 directory with 2 updates (#5140) by @dependabot[bot]
  • chore(deps): bump github/codeql-action from 4.34.1 to 4.35.0 (#5139) by @dependabot[bot]
  • chore(deps-dev): bump @biomejs/biome from 2.4.8 to 2.4.9 (#5136) by @dependabot[bot]
  • chore(deps): bump the typescript group across 1 directory with 2 updates (#5134) by @dependabot[bot]
  • chore(deps): bump requests from 2.32.4 to 2.33.0 in /docs (#5137) by @dependabot[bot]
  • chore(deps): bump the aws-cdk group across 1 directory with 3 updates (#5132) by @dependabot[bot]
  • chore(deps-dev): bump the vitest group across 1 directory with 2 updates (#5135) by @dependabot[bot]
  • chore(deps-dev): bump @valkey/valkey-glide from 2.2.7 to 2.3.0 (#5123) by @dependabot[bot]
  • chore(deps): bump constructs from 10.5.1 to 10.6.0 (#5129) by @dependabot[bot]
  • chore(deps-dev): bump markdownlint-cli2 from 0.21.0 to 0.22.0 (#5130) by @dependabot[bot]
  • chore(deps): bump github/codeql-action from 4.34.0 to 4.34.1 (#5127) by @dependabot[bot]
  • chore(deps): bump mkdocs-material from 9.7.5 to 9.7.6 in /docs (#5122) by @dependabot[bot]
  • chore(deps): bump the aws-sdk-v3 group across 1 directory with 61 updates (#5131) by @dependabot[bot]
  • chore(deps): bump zgosalvez/github-actions-ensure-sha-pinned-actions from 5.0.2 to 5.0.3 (#5121) by @dependabot[bot]
  • chore(deps): bump github/codeql-action from 4.33.0 to 4.34.0 (#5120) by @dependabot[bot]
  • chore(deps): bump squidfunk/mkdocs-material from c373999 to 868ad4d in /docs (#5119) by @dependabot[bot]
  • chore(deps-dev): bump @biomejs/biome from 2.4.7 to 2.4.8 (#5115) by @dependabot[bot]
  • chore(deps): bump valibot from 1.3.0 to 1.3.1 (#5116) by @dependabot[bot]
  • chore(deps): bump release-drafter/release-drafter from 7.1.0 to 7.1.1 (#5114) by @dependabot[bot]

This release was made possible by the following contributors:

@Zelys-DFKH, @dependabot[bot], @dothomson, @dreamorosi, @faberchri, @github-actions[bot], @nateiler, @sdangol, @svozza, @willfarrell, @yashar-new10, dependabot[bot] and github-actions[bot]

Source: README.md, updated 2026-04-14