Class ClientAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.semconv.network.ClientAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
AttributesExtractor<REQUEST,RESPONSE>
public final class ClientAttributesExtractor<REQUEST,RESPONSE>
extends Object
implements AttributesExtractor<REQUEST,RESPONSE>
Extractor of client
attributes.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
ClientAttributesExtractor<REQUEST, RESPONSE> create(ClientAttributesGetter<REQUEST> getter) Creates the client attributes extractor.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.
-
Method Details
-
create
public static <REQUEST,RESPONSE> ClientAttributesExtractor<REQUEST,RESPONSE> create(ClientAttributesGetter<REQUEST> getter) Creates the client attributes extractor.- See Also:
-
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 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>
-