-
Notifications
You must be signed in to change notification settings - Fork 881
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
Add missing InstrumenterBuilder.addRequestListener() #5655
Conversation
@@ -232,10 +232,11 @@ public void end( | |||
|
|||
if (!requestListeners.isEmpty() || !requestMetricListeners.isEmpty()) { | |||
long endNanos = getNanos(endTime); | |||
for (RequestListener requestListener : requestListeners) { | |||
// TODO (trask) call end in the reverse order that start was called? |
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.
We probably don't have to do that - unlike start()
, the end()
method cannot modify the context; also, we're passing the timestamp as an argument, so the exact time of invocation should not matter too.
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.
ya, I just always think of start/end pairs telescoping :)
requestListener.end(context, attributes, endNanos); | ||
} | ||
for (RequestListener requestListener : requestMetricListeners) { | ||
for (RequestListener requestListener : requestListeners) { |
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.
Nit: do we actually need two lists of listeners? Can't we merge requestMetricListeners
into requestListeners
?
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.
I'll send that in a separate PR b/c it moves the requestListeners to after the span is started (which I think is ok, but I'd like to get eyes specifically on that change)
Resolves #5652