Add @BaggageKeyValue annotation for baggage scope management#1400
Open
stuartkemp-e wants to merge 2 commits into
Open
Add @BaggageKeyValue annotation for baggage scope management#1400stuartkemp-e wants to merge 2 commits into
stuartkemp-e wants to merge 2 commits into
Conversation
Addresses micrometer-metrics#1270. Introduce @BaggageKeyValue parameter annotation that puts method argument values into baggage scope for the duration of the method execution. Baggage scopes are automatically closed on method completion, including on exception. The annotation supports three resolution strategies with the following precedence: ValueResolver, expression, and toString() fallback. The 'value' and 'key' attributes control the baggage entry name. Add BaggageKeyValueAnnotationHandler to process annotations and manage baggage scope lifecycle. Add a 5-arg ImperativeMethodInvocationProcessor constructor that accepts resolver and expression resolver providers, allowing both @SpanTag and @BaggageKeyValue to share the same providers. Signed-off-by: Stuart Kemp <stuart.kemp@esure.com>
2df50f6 to
b0e9519
Compare
Signed-off-by: Stuart Kemp <stuart.kemp@esure.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #1270.
Introduce @BaggageKeyValue parameter annotation that puts method argument values into baggage scope for the duration of the method execution. Baggage scopes are automatically closed on method completion, including on exception.
The annotation supports three resolution strategies with the following precedence: ValueResolver, expression, and toString() fallback. The 'value' and 'key' attributes control the baggage entry name.
Add BaggageKeyValueAnnotationHandler to process annotations and manage baggage scope lifecycle. Add a 5-arg ImperativeMethodInvocationProcessor constructor that accepts resolver and expression resolver providers, allowing both @SpanTag and @BaggageKeyValue to share the same providers.