Skip to content

Commit

Permalink
Change context propagation debug failures from error to warn (#8601)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed May 30, 2023
1 parent f3a58b2 commit ed9cac6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package io.opentelemetry.instrumentation.api.internal;

import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;

import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Context;
Expand Down Expand Up @@ -75,10 +75,10 @@ public static void debugContextLeakIfEnabled() {

Context current = Context.current();
if (current != Context.root()) {
logger.severe("Unexpected non-root current context found when extracting remote context!");
logger.warning("Unexpected non-root current context found when extracting remote context!");
Span currentSpan = Span.fromContextOrNull(current);
if (currentSpan != null) {
logger.log(SEVERE, "It contains this span: {0}", currentSpan);
logger.log(WARNING, "It contains this span: {0}", currentSpan);
}

debugContextPropagation(current);
Expand Down Expand Up @@ -125,7 +125,7 @@ private static void debugContextPropagation(Context context) {
sb.append("\nwhich was propagated from:");
}
}
logger.log(SEVERE, "a context leak was detected. it was propagated from: {0}", sb);
logger.log(WARNING, "a context leak was detected. it was propagated from: {0}", sb);
}
}

Expand Down

0 comments on commit ed9cac6

Please sign in to comment.