-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow for more customisation of the tracing span #1303
Comments
Thanks for bringing up this issue. It touches both, the SPI and the Brave Tracer implementations. Looking at the code, we have I'm considering to overload The second step would be adding an overload to Let me know what you think about it. |
Span customizer now accepts RedisCommand and Span to customize tracing spans based on the actual command.
That's in place now. |
Feature Request
Currently you are providing an ability to include the arguments of the Redis command in the tag of the span, see CommandHandler. This is controlled by a single boolean flag to either include it or exclude those arguments. An example of me doing this is by applying the following Bean in a Spring Application:
The usage of this boolean value in the underlying CommandHandler looks like:
As this includes all the args, it will include both the key and value for set commands. I would prefer to not have the values of my caches included in my tracing spans but are happy to have the key in there as this will help with debugging.
It would be great if we had more control as a consumer to customise what tags we can include in our Redis Tracing Spans.
Is your feature request related to a problem? Please describe
No
Describe the solution you'd like
One solution that I have been thinking of would be to allow consumers to provide their own functions that can decorate the Spans. It could just even be a
BiConsumer<Span, RedisCommand<?, ?>>
instead of a boolean value. The consumer API would look something like:Depending on what we want to do with the existing boolean flag we could allow the existing functionality and new functionality to work together:
Under the hood both the
includeCommandArgsInSpanTags
andaddSpanDecorator
could use the same underlying list of "SpanDecorators". For example:Note instead of a
BiConsumer
we could create our own Functional Interface, e.g. name itSpanDecorator
orSpanCommandDecorator
, etc. Up for suggestions.Describe alternatives you've considered
There is currently the
spanCustomizer
but that does not seem to have any extra information coming from the actual command that is being performed. This could be something that could be extended with more information but I am not sure if that is possible.Teachability, Documentation, Adoption, Migration Strategy
If the main solution is considered the way to go, this would not be a breaking change and therefore no migration documentation or other information would be needed. This should just be documented like any other feature with this libraries tracing.
The text was updated successfully, but these errors were encountered: