Class DbClientSpanNameExtractor<REQUEST>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.db.DbClientSpanNameExtractor<REQUEST>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>
public abstract class DbClientSpanNameExtractor<REQUEST>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>
-
Method Summary
Modifier and TypeMethodDescriptionprotected StringcomputeSpanName(String namespace, String operationName, String collectionName, String storedProcedureName) protected StringcomputeSpanNameStable(DbClientAttributesGetter<REQUEST, ?> getter, REQUEST request, String operation, String collectionName, String storedProcedureName) Computes the span name following stable semconv fallback order.static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(DbClientAttributesGetter<REQUEST, ?> getter) Returns aSpanNameExtractorthat constructs the span name according to DB semantic conventions.static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(SqlClientAttributesGetter<REQUEST, ?> getter) Returns aSpanNameExtractorthat constructs the span name according to DB semantic conventions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor
extract
-
Method Details
-
create
public static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(DbClientAttributesGetter<REQUEST, ?> getter) Returns aSpanNameExtractorthat constructs the span name according to DB semantic conventions. -
create
public static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(SqlClientAttributesGetter<REQUEST, ?> getter) Returns aSpanNameExtractorthat constructs the span name according to DB semantic conventions. -
computeSpanName
-
computeSpanNameStable
protected String computeSpanNameStable(DbClientAttributesGetter<REQUEST, ?> getter, REQUEST request, @Nullable String operation, @Nullable String collectionName, @Nullable String storedProcedureName) Computes the span name following stable semconv fallback order.Fallback order:
- {db.operation.name} {target} if operation is available
- {target} if only target is available
- {db.system.name} if nothing else is available
Target fallback order:
- {db.collection.name}
- {db.stored_procedure.name}
- {db.namespace}
- {server.address:server.port}
-