Class DbAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
-
- io.opentelemetry.instrumentation.api.instrumenter.db.DbAttributesExtractor<REQUEST,RESPONSE>
-
- Direct Known Subclasses:
SqlAttributesExtractor
public abstract class DbAttributesExtractor<REQUEST,RESPONSE> extends AttributesExtractor<REQUEST,RESPONSE>
Extractor of database attributes. Instrumentations of database libraries should extend this class, definingDbAttributesExtractorwith the actual request type of the instrumented library. If an attribute is not available in this library, it is appropriate to returnnullfrom the protected attribute methods, but implement as many as possible for best compliance with the OpenTelemetry specification.
-
-
Constructor Summary
Constructors Constructor Description DbAttributesExtractor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @Nullable StringconnectionString(REQUEST request)protected abstract @Nullable Stringname(REQUEST request)protected voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response)Extracts attributes from theAttributesExtractorandAttributesExtractorinto theAttributesBuilderat the end of a request.protected voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)Extracts attributes from theAttributesExtractorinto theAttributesBuilderat the beginning of a request.protected abstract @Nullable Stringoperation(REQUEST request)protected abstract @Nullable Stringstatement(REQUEST request)protected abstract @Nullable Stringsystem(REQUEST request)protected abstract @Nullable Stringuser(REQUEST request)-
Methods inherited from class io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor
set
-
-
-
-
Method Detail
-
onStart
protected void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)Description copied from class:AttributesExtractorExtracts attributes from theAttributesExtractorinto theAttributesBuilderat the beginning of a request.- Specified by:
onStartin classAttributesExtractor<REQUEST,RESPONSE>
-
onEnd
protected final void onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response)Description copied from class:AttributesExtractorExtracts attributes from theAttributesExtractorandAttributesExtractorinto theAttributesBuilderat the end of a request.- Specified by:
onEndin classAttributesExtractor<REQUEST,RESPONSE>
-
-