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

Capture exception on finatra controller span #4669

Merged
merged 3 commits into from
Nov 19, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 18, 2021

Resolves #1131


@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
public static void handleException(
@Advice.Return Response response, @Advice.Argument(1) Throwable throwable) {
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about adding returns(named("com.twitter.finagle.http.Response")) to the matcher?

Comment on lines -68 to +74
// Finatra doesn't propagate the stack trace or exception to the instrumentation
// so the normal errorAttributes() method can't be used
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

@trask trask merged commit c7a4045 into open-telemetry:main Nov 19, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Capture exception on finatra controller span

* add return type check

* store VirtualField in a static field
@laurit laurit deleted the finatra-exception branch July 6, 2023 17:46
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.

Finatra controller spans are not capturing exceptions
4 participants