Better info message (#937)

This commit is contained in:
Trask Stalnaker 2020-08-09 21:31:58 -07:00 committed by GitHub
parent f9f6d1f6b3
commit 51717d1e2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -59,8 +59,10 @@ public class UnshadedTracerProvider implements TracerProvider, Obfuscated {
public Object unobfuscate() {
if (!messageAlreadyLogged.getAndSet(true)) {
String message =
"direct usage of the OpenTelemetry SDK is not supported when running agent"
+ " (run with debug logging to see stack trace)";
"direct usage of the OpenTelemetry SDK, e.g. using OpenTelemetrySdk.getTracerProvider()"
+ " instead of OpenTelemetry.getTracerProvider(), is not supported when running agent"
+ " (see https://github.com/open-telemetry/opentelemetry-java-instrumentation#troubleshooting"
+ " for how to run with debug logging, which will log stack trace with this message)";
if (log.isDebugEnabled()) {
log.debug(message, new Exception("stack trace"));
} else {