-
Notifications
You must be signed in to change notification settings - Fork 248
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
Adds on_ending callback to allow processors to mutate spans before End operation #1713
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an experimental feature and may have breaking changes. How about specifying that here ?
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.
Thank you for the suggestion. I will update it.
… official spec Signed-off-by: Gustavo Pantuza <gustavopantuza@gmail.com>
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.
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
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.
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.
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.
Thank you!
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_ending
callback toSpanProcessor
class.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_ending
callback is optional within ANYSpanProcessor
. Only called when exists.on_ending
on_ending
on_ending
callbacks are executed before any SpanProcessor'son_end
callback is invoked