default the tracer name to an empty string (#3170)
This commit is contained in:
parent
7d31cddf19
commit
7c9ea8b0f6
|
@ -30,7 +30,7 @@ import javax.annotation.Nullable;
|
||||||
*/
|
*/
|
||||||
public final class SdkTracerProvider implements TracerProvider, Closeable {
|
public final class SdkTracerProvider implements TracerProvider, Closeable {
|
||||||
private static final Logger logger = Logger.getLogger(SdkTracerProvider.class.getName());
|
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 TracerSharedState sharedState;
|
||||||
private final ComponentRegistry<SdkTracer> tracerSdkComponentRegistry;
|
private final ComponentRegistry<SdkTracer> tracerSdkComponentRegistry;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public final class SdkTracerProvider implements TracerProvider, Closeable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tracer get(String instrumentationName, @Nullable String instrumentationVersion) {
|
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()) {
|
if (instrumentationName == null || instrumentationName.isEmpty()) {
|
||||||
logger.fine("Tracer requested without instrumentation name.");
|
logger.fine("Tracer requested without instrumentation name.");
|
||||||
instrumentationName = DEFAULT_TRACER_NAME;
|
instrumentationName = DEFAULT_TRACER_NAME;
|
||||||
|
|
Loading…
Reference in New Issue