You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have the ability to do this with the CorrelationId, I'd like to be able to use it as well for arbitrary fields in the request, like a deviceId or userId. This would be a new parameter in the Logging attribute called ExtractedKeyPaths. The name could be improved :)
Solution/User Experience
To add these fields (deviceId and userId), assuming they are stored in a header, we would add them to the attribute like this:
gregsinclair42
changed the title
Feature request: Add ability to extract arbitrary fields from the request and store in keys
Feature request: Add ability to extract arbitrary fields from the request and store in log keys
Mar 12, 2025
HI @gregsinclair42 thank you so much for opening the issue and creating the pull request.
We have a Powertools maintainers sync meeting next Monday so we will be discussing this feature.
Let me share with you my first impressions, while I do believe the use cases makes sense we are trying to move away from doing stuff in the decorator and doing more outside of it.
For this use case this could be solved doing an AppendKey inside the handler which would be a bit cleaner than json pointer expressions in the decorator.
But again thank you for the issue, I will give you an update on Monday
Use case
We already have the ability to do this with the CorrelationId, I'd like to be able to use it as well for arbitrary fields in the request, like a deviceId or userId. This would be a new parameter in the Logging attribute called ExtractedKeyPaths. The name could be improved :)
Solution/User Experience
To add these fields (deviceId and userId), assuming they are stored in a header, we would add them to the attribute like this:
Here is an example PR with this change: #817
Acknowledgment
The text was updated successfully, but these errors were encountered: