Skip to content

docs(event_handler): demonstrate how to combine logger correlation ID and middleware #3064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented Sep 8, 2023

Issue number: #2917

Summary

Tiny change to address a customer's question on how to use Logger to extract correlation ID from a dynamic part of the payload, and fallback to a request ID if not available.


PS. Discussed with @sthulb that this should be a built-in feature to inject into the context, so customers don't depend on Logger for getting correlation ID nor yet another middleware.

For example: app = ApiGatewayRestResolver(correlation_id_path="headers...")

Changes

Please provide a summary of what's being changed

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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.

* develop:
  chore: cleanup, add test for single and nested
  fix(parameters): make cache aware of single vs multiple calls
  docs(event_handler): use correct correlation_id for logger in middleware example (aws-powertools#3063)
  chore(deps-dev): bump pytest from 7.4.1 to 7.4.2 (aws-powertools#3057)
@heitorlessa heitorlessa requested a review from a team September 8, 2023 10:10
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 8, 2023
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge need-issue PRs that are missing related issues labels Sep 8, 2023
sthulb
sthulb previously approved these changes Sep 8, 2023
sthulb
sthulb previously approved these changes Sep 8, 2023
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 8, 2023
@heitorlessa heitorlessa removed do-not-merge need-issue PRs that are missing related issues labels Sep 8, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@sthulb sthulb requested review from sthulb and removed request for a team September 8, 2023 10:57
@sthulb sthulb merged commit b523583 into aws-powertools:develop Sep 8, 2023
@heitorlessa heitorlessa deleted the docs/middleware-correlation-id-var branch September 8, 2023 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants