Skip to content

Commit

Permalink
Ignore all errors when doing some non-essential reflection in otel (#…
Browse files Browse the repository at this point in the history
…42586)

* Ignore all errors when doing some reflection in otel
  • Loading branch information
lmolkova authored Oct 27, 2024
1 parent 862517e commit e8a5283
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ public class OpenTelemetryTracer implements com.azure.core.util.tracing.Tracer {
// to resolve the actual io.opentelemetry.context.Context.
applicationContextClass = Class.forName("#io.opentelemetry.context.Context".substring(1));
convertAppToAgentContextMethod = agentCtxStorageClass.getMethod("getAgentContext", applicationContextClass);
} catch (ReflectiveOperationException t) {
} catch (Throwable t) {
// it's expected if we're not running in the agent
LOGGER.verbose("Failed to resolve AgentContextStorage.getAgentContext or one of its dependencies", t);
} catch (RuntimeException t) {
throw LOGGER.logExceptionAsError(t);
}
}

Expand Down

0 comments on commit e8a5283

Please sign in to comment.