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 Details

    • create

      public static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(DbClientAttributesGetter<REQUEST,?> getter)
      Returns a SpanNameExtractor that 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 a SpanNameExtractor that constructs the span name according to DB semantic conventions.
    • createWithGenericOldSpanName

      @Deprecated public static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> createWithGenericOldSpanName(SqlClientAttributesGetter<REQUEST,?> getter)
      Deprecated.
      Returns a SpanNameExtractor for instrumentations that previously used DbClientAttributesGetter and are migrating to SqlClientAttributesGetter.

      Unlike create(SqlClientAttributesGetter), this method produces old semconv span names in the format operation namespace (without collection name), matching the behavior these instrumentations had before migration. For stable semconv, SQL parsing is used normally.

      Once old database semconv are dropped, callers should switch to create(SqlClientAttributesGetter).