Change context propagation debug failures from error to warn (#8601)

This commit is contained in:
Lauri Tulmin 2023-05-30 14:56:41 +03:00 committed by GitHub
parent f3a58b2524
commit ed9cac6fa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
package io.opentelemetry.instrumentation.api.internal; 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.api.trace.Span;
import io.opentelemetry.context.Context; import io.opentelemetry.context.Context;
@ -75,10 +75,10 @@ public final class ContextPropagationDebug {
Context current = Context.current(); Context current = Context.current();
if (current != Context.root()) { 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); Span currentSpan = Span.fromContextOrNull(current);
if (currentSpan != null) { if (currentSpan != null) {
logger.log(SEVERE, "It contains this span: {0}", currentSpan); logger.log(WARNING, "It contains this span: {0}", currentSpan);
} }
debugContextPropagation(current); debugContextPropagation(current);
@ -125,7 +125,7 @@ public final class ContextPropagationDebug {
sb.append("\nwhich was propagated from:"); 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);
} }
} }