Adds on_ending callback to allow processors to mutate spans before End operation#1713
Conversation
…ssors Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
…ght after setting the end timestamp Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
…nto span-processor-on-ending-interface
| # | ||
| # @param [Span] span the {Span} that just is ending (still mutable). | ||
| # @return [void] | ||
| def on_ending(span); end |
There was a problem hiding this comment.
This is an experimental feature and may have breaking changes. How about specifying that here ?
There was a problem hiding this comment.
Thank you for the suggestion. I will update it.
… official spec Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
kaylareopelle
left a comment
There was a problem hiding this comment.
Thanks for your PR, @pantuza! I want to think about this a little more, but I have some feedback on the documentation for now.
Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com>
Co-authored-by: Kayla Reopelle <87386821+kaylareopelle@users.noreply.github.com>
Thank you for your feedback and documentation suggestions. I really appreciate it. To give you a little background context, have started this work because of the following discussion in this Pull Request #1713 |
1713 is this pull request. Is there a different discussion you meant to link to? |
…nto span-processor-on-ending-interface
…za/opentelemetry-ruby into span-processor-on-ending-interface
mwear
left a comment
There was a problem hiding this comment.
Overall, this looks good to me. For reference, Java already has this: open-telemetry/opentelemetry-java#6367. We chose to rename the end method to finish since end is a Ruby keyword. One thought I had was whether or not we should considering calling this on_finishing, but I am ok with this as is. Curious if anyone else has any thoughts.
I do like the idea of using |
|
I also like the idea of using |
…nto span-processor-on-ending-interface
…th project name strategy Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
This Pull Request aims to solve the issue #1695 by adding the
on_endingcallback toSpanProcessorclass.It also make sure to call that method during the span End operation (
finish()method), right after the endtimestamp has been set but while the span is still mutable.
Based on the spec, this implementation complies with:
on_endingcallback is optional within ANYSpanProcessor. Only called when exists.on_endingon_endingon_endingcallbacks are executed before any SpanProcessor'son_endcallback is invoked