Class SqlClientAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.db.SqlClientAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,,RESPONSE> io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
public final class SqlClientAttributesExtractor<REQUEST,RESPONSE>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>, io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
Extractor of database
attributes. This class is designed with SQL (or SQL-like) database clients in mind.
It sets the same set of attributes as DbClientAttributesExtractor plus an additional
db.sql.table attribute. The raw SQL statements returned by the SqlClientAttributesGetter.getRawQueryTexts(Object) method are sanitized before use, all
statement parameters are removed.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
SqlClientAttributesExtractorBuilder<REQUEST, RESPONSE> builder(SqlClientAttributesGetter<REQUEST, RESPONSE> getter) Returns a newSqlClientAttributesExtractorBuilderthat can be used to configure the SQL client attributes extractor.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST, RESPONSE> create(SqlClientAttributesGetter<REQUEST, RESPONSE> getter) Creates the SQL client attributes extractor with default configuration.io.opentelemetry.instrumentation.api.internal.SpanKeyThis method is internal and is hence not for public use.voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error) voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)
-
Method Details
-
create
public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(SqlClientAttributesGetter<REQUEST, RESPONSE> getter) Creates the SQL client attributes extractor with default configuration. -
builder
public static <REQUEST,RESPONSE> SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> builder(SqlClientAttributesGetter<REQUEST, RESPONSE> getter) Returns a newSqlClientAttributesExtractorBuilderthat can be used to configure the SQL client attributes extractor. -
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-
internalGetSpanKey
public io.opentelemetry.instrumentation.api.internal.SpanKey internalGetSpanKey()This method is internal and is hence not for public use. Its API is unstable and can change at any time.- Specified by:
internalGetSpanKeyin interfaceio.opentelemetry.instrumentation.api.internal.SpanKeyProvider
-