Class SqlClientAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.db.SqlClientAttributesExtractor<REQUEST,RESPONSE>
-
- All Implemented Interfaces:
AttributesExtractor<REQUEST,RESPONSE>
public final class SqlClientAttributesExtractor<REQUEST,RESPONSE> extends Object
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
DbClientAttributesExtractorplus an additionaldb.sql.tableattrubute. The raw SQL statements returned by theSqlClientAttributesGetter.rawStatement(Object)method are sanitized before use, all statement parameters are removed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <REQUEST,RESPONSE>
SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE>builder(SqlClientAttributesGetter<REQUEST> getter)Returns a newSqlClientAttributesExtractorBuilderthat can be used to configure the SQL client attributes extractor.static <REQUEST,RESPONSE>
SqlClientAttributesExtractor<REQUEST,RESPONSE>create(SqlClientAttributesGetter<REQUEST> getter)Creates the SQL client attributes extractor with default configuration.voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error)Extracts attributes from theContext, theAttributesExtractorand eitherAttributesExtractororerrorinto theAttributesBuilderat the end of a request.voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)Extracts attributes from theContextand theAttributesExtractorinto theAttributesBuilderat the beginning of a request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor
onEnd, onStart, set
-
-
-
-
Method Detail
-
create
public static <REQUEST,RESPONSE> SqlClientAttributesExtractor<REQUEST,RESPONSE> create(SqlClientAttributesGetter<REQUEST> getter)
Creates the SQL client attributes extractor with default configuration.
-
builder
public static <REQUEST,RESPONSE> SqlClientAttributesExtractorBuilder<REQUEST,RESPONSE> builder(SqlClientAttributesGetter<REQUEST> 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)Description copied from interface:AttributesExtractorExtracts attributes from theContextand theAttributesExtractorinto theAttributesBuilderat the beginning of a request.- Specified by:
onStartin interfaceAttributesExtractor<REQUEST,RESPONSE>
-
onEnd
public final void onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error)Description copied from interface:AttributesExtractorExtracts attributes from theContext, theAttributesExtractorand eitherAttributesExtractororerrorinto theAttributesBuilderat the end of a request.- Specified by:
onEndin interfaceAttributesExtractor<REQUEST,RESPONSE>
-
-