Skip to content

feat(event-handler): add tracer middleware for HTTP routes - #4982

Merged
svozza merged 20 commits into
aws-powertools:mainfrom
arnabrahman:4821-tracer-http-middleware
Feb 5, 2026
Merged

svozza merged 20 commits into
aws-powertools:mainfrom
arnabrahman:4821-tracer-http-middleware

Conversation

@arnabrahman

Copy link
Copy Markdown
Contributor

Summary

Add tracer middleware for tracing HTTP requests automatically

Changes

  • Create tracing middleware to trace HTTP routes
  • Capture cold start, service name annotation
  • Capture JSON response as metadata; other responses are not captured
  • When tracing is disabled & during streaming, the middleware is skipped
  • Capture route error during tracing
  • Keep the tracer package in peer-dependency & expose the tracer middleware as a subpath for avoiding tracer dependency
  • 100% unit tests are covered
  • Docs are added for tracer middleware

Issue number: closes #4821


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size Bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Feb 1, 2026
@boring-cyborg boring-cyborg Bot added dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Feb 1, 2026
@arnabrahman
arnabrahman marked this pull request as ready for review February 1, 2026 05:18
@dreamorosi
dreamorosi requested a review from svozza February 3, 2026 09:14
@arnabrahman
arnabrahman marked this pull request as draft February 3, 2026 13:22
@arnabrahman
arnabrahman marked this pull request as ready for review February 3, 2026 13:53
@arnabrahman
arnabrahman requested a review from svozza February 3, 2026 15:43
@dreamorosi

Copy link
Copy Markdown
Contributor

Hi @svozza - do you think this is ready to be merged?

@svozza

svozza commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Oh yes, sorry, I thought I'd approved it already!

@svozza
svozza merged commit 8be6157 into aws-powertools:main Feb 5, 2026
46 checks passed
@arnabrahman
arnabrahman deleted the 4821-tracer-http-middleware branch February 5, 2026 10:10
@svozza

svozza commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Forget to say yesterday, great work as always @arnabrahman!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Changes that touch dependencies, e.g. Dependabot, etc. documentation Improvements or additions to documentation event-handler This item relates to the Event Handler Utility size/XL PRs between 500-999 LOC, often PRs that grown with feedback tests PRs that add or change tests

3 participants