Skip to content

Commit

Permalink
fix spurious context clear when thread detached from wallclock profil…
Browse files Browse the repository at this point in the history
…ing (#6836)
  • Loading branch information
richardstartin authored Mar 22, 2024
1 parent 373481b commit b856443
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class DatadogProfilingIntegration implements ProfilingContextIntegration
new Stateful() {
@Override
public void close() {
// this implementation is stateless so nothing to do here
DDPROF.clearSpanContext();
DDPROF.clearContextValue(SPAN_NAME_INDEX);
DDPROF.clearContextValue(RESOURCE_NAME_INDEX);
}

@Override
Expand Down Expand Up @@ -60,7 +62,6 @@ public void onAttach() {

@Override
public void onDetach() {
clearContext();
if (WALLCLOCK_ENABLED) {
DDPROF.removeThread();
}
Expand Down

0 comments on commit b856443

Please sign in to comment.