-
Notifications
You must be signed in to change notification settings - Fork 408
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
feat(logging): Add correlation_id support #321
Conversation
Prototype idea for correlation_id support in logger
@michaelbrewer could you push an empty commit to test the label one more time, plz? |
That's great, thank you! While we think through the other RFC to allow a more cohesive correlation ID across utilities, may I ask two enhancements where one is optional?
I say optional because dictionary lookup will always be faster than JMESPath, so we'd want to do the former first and have JMESPath as a fallback mechanism instead of doing recursion ourselves. |
Scratch that.. too early in the day for me. It's indeed better to handle that in the Uber Supreme Leader Handler, where we could have a Config available to all utilities, where Logger could use, Metrics could use to set correlation ID as metadata, Tracer as annotation, etc. It kinda sucks though having to ask customers to add an additional line to set correlation ID when they likely already have |
Codecov Report
@@ Coverage Diff @@
## develop #321 +/- ##
========================================
Coverage 99.88% 99.88%
========================================
Files 91 91
Lines 3347 3352 +5
Branches 164 165 +1
========================================
+ Hits 3343 3348 +5
Misses 2 2
Partials 2 2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny change to improve SEO on docs, and we're good to merge 🎉 !
I'll write another PR to include the new correlation_path in the docs too
@pankajagrawal16 FYI - We're adding the first iteration of setting correlation ID. This is before we work on an uber duper decorator to rule them all with a single config to prevent the confusion of many decorators while also allowing customers to create their own. The latter doesn't necessarily translates to Java, but the correlation ID is a good one we want to have in the core utilities |
Co-authored-by: Heitor Lessa <heitor.lessa@hotmail.com>
Issue #, if available:
#9
Description of changes:
Add new method
set_correlation_id
to allow for customers to set correlation_id in the loggerExample API Gateway Proxy Event
Usage via logger.set_correlation_id:
Via
correlation_id_path
Cloudwatch log
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.