Skip to content
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

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

trask
Copy link
Member

@trask trask commented Mar 21, 2022

Resolves #5652

@trask trask requested a review from a team as a code owner March 21, 2022 18:53
@@ -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?
Copy link
Member

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.

Copy link
Member Author

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) {
Copy link
Member

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?

Copy link
Member Author

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)

@trask trask merged commit 5ab23f2 into open-telemetry:main Mar 22, 2022
@trask trask deleted the request-listeners branch March 22, 2022 18:45
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

requestListeners In InstrumenterBuilder
4 participants