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

Update instrumentation to always close scope before ending span #4596

Open
trask opened this issue Nov 5, 2021 · 0 comments · May be fixed by #12952
Open

Update instrumentation to always close scope before ending span #4596

trask opened this issue Nov 5, 2021 · 0 comments · May be fixed by #12952
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request

Comments

@trask
Copy link
Member

trask commented Nov 5, 2021

From #4544 (comment)

ByteBuddy instrumentation (@OnMethodEnter/@OnMethodExit) follows this pattern, so would be good for consistency for other instrumentation to follow it also. In particular, Context.current() would be consistent in all end hooks, e.g. SpanProcessor or Instrumenter.

  Response response;
  try (Scope scope = context.makeCurrent()) {
    response = actualMethod(request);
  } catch (Throwable t) {
    instrumenter.end(context, request, null, t);
  }
  instrumenter.end(context, request, response, null);
  return response;

If we make this change we should update the Instrumenter documentation linked above also.

@trask trask added the enhancement New feature or request label Nov 5, 2021
@trask trask added the contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome label Aug 24, 2023
@trask trask linked a pull request Dec 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant