gax-java icon indicating copy to clipboard operation
gax-java copied to clipboard

Fix incomplete javadoc for TracedResponseObserver or change behavior

Open igorbernstein2 opened this issue 4 years ago • 3 comments

I accidentally left incomplete javadoc for the TracedResponseObserver class. It was supposed to read

 * <p>The operation will be marked as complete before notifying the wrapped observer. Which means
 * that the span of the instrumentation will not include processing of the innerObserver's
 * onComplete.
 *

However, while trying to remember my intent when writing that class, I'm not sure if this is the desired behavior. My original intention was to try exclude the caller's processing from metrics gathered callable chain below. However looking at it with fresh eyes, I dont think that. possible because there many callbacks of onResponse that will invoke observers callable above. So now it seems arbitrary to exclude onComplete from the span.

I'm not sure if this behavior should be changed or just documented. I would like a second opinion before making the change

igorbernstein2 avatar Dec 18 '20 01:12 igorbernstein2

Just documenting the behavior SGTM.

miraleung avatar Dec 29 '20 20:12 miraleung

+1

Unless the current implementation is fundamentally wrong, I think just making the documentation match the implementation is better.

Documenting is easier.

Also, sometimes "fresh eye" view could be an indication of forgetting something important from the past which actually caused you make the original implementation. I.e. just making documentation match the implementation also looks safer.

doc vs implementation -> 2:0.

vam-google avatar Dec 29 '20 23:12 vam-google

Ok, I'll update the docs

igorbernstein2 avatar Jan 06 '21 16:01 igorbernstein2