Package io.helidon.tracing.jersey
Class AbstractTracingFilter
- java.lang.Object
-
- io.helidon.tracing.jersey.AbstractTracingFilter
-
- All Implemented Interfaces:
ContainerRequestFilter,ContainerResponseFilter
- Direct Known Subclasses:
MpTracingFilter,TracingFilter
@ConstrainedTo(SERVER) @PreMatching public abstract class AbstractTracingFilter extends Object implements ContainerRequestFilter, ContainerResponseFilter
Tracing filter base.
-
-
Constructor Summary
Constructors Constructor Description AbstractTracingFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidconfigureSpan(Tracer.SpanBuilder spanBuilder)Configure additional properties of a span that is named and has a parent.voidfilter(ContainerRequestContext requestContext)voidfilter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)protected abstract StringspanName(ContainerRequestContext context)Create name of the newly created span.protected abstract booleantracingEnabled(ContainerRequestContext context)Whether this tracing filter is enabled.protected Stringurl(ContainerRequestContext requestContext)Resolves host name based on the "host" header.
-
-
-
Method Detail
-
filter
public void filter(ContainerRequestContext requestContext)
- Specified by:
filterin interfaceContainerRequestFilter
-
url
protected String url(ContainerRequestContext requestContext)
Resolves host name based on the "host" header. If this header is not set, thenURI.toString()is called.- Parameters:
requestContext- request context- Returns:
- resolved url
-
filter
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
- Specified by:
filterin interfaceContainerResponseFilter
-
tracingEnabled
protected abstract boolean tracingEnabled(ContainerRequestContext context)
Whether this tracing filter is enabled.- Parameters:
context- request context- Returns:
- true if filter should trigger and start a new span
-
spanName
protected abstract String spanName(ContainerRequestContext context)
Create name of the newly created span.- Parameters:
context- request context- Returns:
- name of the span to be created
-
configureSpan
protected abstract void configureSpan(Tracer.SpanBuilder spanBuilder)
Configure additional properties of a span that is named and has a parent.- Parameters:
spanBuilder- builder of the new span
-
-