default the tracer name to an empty string (#3170)

This commit is contained in:
John Watson 2021-04-28 10:24:17 -07:00 committed by GitHub
parent 7d31cddf19
commit 7c9ea8b0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ import javax.annotation.Nullable;
*/
public final class SdkTracerProvider implements TracerProvider, Closeable {
private static final Logger logger = Logger.getLogger(SdkTracerProvider.class.getName());
static final String DEFAULT_TRACER_NAME = "unknown";
static final String DEFAULT_TRACER_NAME = "";
private final TracerSharedState sharedState;
private final ComponentRegistry<SdkTracer> tracerSdkComponentRegistry;
@ -65,7 +65,7 @@ public final class SdkTracerProvider implements TracerProvider, Closeable {
@Override
public Tracer get(String instrumentationName, @Nullable String instrumentationVersion) {
// Per the spec, both null and empty are "invalid" and a "default" should be used.
// Per the spec, both null and empty are "invalid" and a default value should be used.
if (instrumentationName == null || instrumentationName.isEmpty()) {
logger.fine("Tracer requested without instrumentation name.");
instrumentationName = DEFAULT_TRACER_NAME;