Interface AttributesExtractor<REQUEST,RESPONSE>
- All Known Implementing Classes:
ClientAttributesExtractor, HttpClientAttributesExtractor, HttpServerAttributesExtractor, NetworkAttributesExtractor, ServerAttributesExtractor, UrlAttributesExtractor
public interface AttributesExtractor<REQUEST,RESPONSE>
Extractor of
Attributes for a given request and response. Will be called on start with just the REQUEST and again
on end with both
REQUEST and RESPONSE to allow populating attributes at each stage of a request's
lifecycle. It is best to populate as many attributes as possible in onStart(AttributesBuilder, Context, Object) to have them available during span sampling.-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE, T>
AttributesExtractor<REQUEST, RESPONSE> constant(io.opentelemetry.api.common.AttributeKey<T> attributeKey, T attributeValue) Returns anAttributesExtractorimplementation that always extracts the provided constant value on the request start.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) Extracts attributes from theContextand theREQUESTinto theAttributesBuilderat the beginning of a request.
-
Method Details
-
onStart
-
onEnd
-
constant
static <REQUEST,RESPONSE, AttributesExtractor<REQUEST,T> RESPONSE> constant(io.opentelemetry.api.common.AttributeKey<T> attributeKey, T attributeValue) Returns anAttributesExtractorimplementation that always extracts the provided constant value on the request start.
-