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

jetty9 http client: don't implement Response.CompleteListener #11579

Merged

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jun 13, 2024

The onComplete method isn't really called because we never register the complete listener in

Having the success and failure listeners should be enough.

@laurit laurit requested a review from a team as a code owner June 13, 2024 09:29
Comment on lines +136 to +138
if (this.context != null) {
instrumenter.end(this.context, response.getRequest(), response, null);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.context != null) {
instrumenter.end(this.context, response.getRequest(), response, null);
}
if (this.context != null) {
instrumenter.end(this.context, response.getRequest(), response, null);
} else {
logger.fine("onSuccess - could not find an otel context");
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this log line really useful? Looking at the code currently context being null doesn't really indicate that anything is wrong. Imo it would be better to refactor this so that the listener isn't added at all when span isn't started.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo it would be better to refactor this so that the listener isn't added at all when span isn't started.
👍

@laurit laurit merged commit 4d3802a into open-telemetry:main Jun 14, 2024
53 checks passed
@laurit laurit deleted the jetty9-http-client-remove-complete-listener branch June 14, 2024 12:19
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.

None yet

3 participants