Class OpenTelemetryHttpRequestFilter
- All Implemented Interfaces:
HttpExecutionStrategyInfluencer,StreamingHttpClientFilterFactory,StreamingHttpConnectionFilterFactory,ExecutionStrategyInfluencer<HttpExecutionStrategy>
The filter gets a Tracer with "io.servicetalk" instrumentation scope name.
Append this filter before others that are expected to see Scope for this request/response. Filters
appended after this filter that use operators with the after* prefix on
response meta data or the
StreamingHttpResponse.transformMessageBody(UnaryOperator) response message body.
(e.g. Publisher.afterFinally(Runnable)) will execute after this filter invokes Scope.close() and
therefore will not see the Span for the current request/response.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead.OpenTelemetryHttpRequestFilter(io.opentelemetry.api.OpenTelemetry openTelemetry, String componentName) Deprecated.this method is internal, no user should be setting theOpenTelemetryas it is obtained by usingGlobalOpenTelemetry.get()and there should be no other implementations but the one available in the classpath, this constructor will be removed in the future releases.OpenTelemetryHttpRequestFilter(String componentName) Deprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead.OpenTelemetryHttpRequestFilter(String componentName, OpenTelemetryOptions opentelemetryOptions) Deprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead. -
Method Summary
Modifier and TypeMethodDescriptioncreate(FilterableStreamingHttpClient client) Creates aStreamingHttpClientFilterusing the providedStreamingHttpClientFilter.create(FilterableStreamingHttpConnection connection) Create aStreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.final HttpExecutionStrategyReturn anExecutionStrategythat describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy, requiredOffloads
-
Constructor Details
-
OpenTelemetryHttpRequestFilter
@Deprecated public OpenTelemetryHttpRequestFilter(io.opentelemetry.api.OpenTelemetry openTelemetry, String componentName) Deprecated.this method is internal, no user should be setting theOpenTelemetryas it is obtained by usingGlobalOpenTelemetry.get()and there should be no other implementations but the one available in the classpath, this constructor will be removed in the future releases. UseOpenTelemetryHttpRequesterFilter.Builderinstead.Create a new instance.- Parameters:
openTelemetry- theOpenTelemetry.componentName- The component name used during building new spans.
-
OpenTelemetryHttpRequestFilter
Deprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead.Create a new instance, searching for any instance of an opentelemetry available.- Parameters:
componentName- The component name used during building new spans.
-
OpenTelemetryHttpRequestFilter
@Deprecated public OpenTelemetryHttpRequestFilter(String componentName, OpenTelemetryOptions opentelemetryOptions) Deprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead.Create a new instance, searching for any instance of an opentelemetry available.- Parameters:
componentName- The component name used during building new spans.opentelemetryOptions- extra options to create the opentelemetry filter
-
OpenTelemetryHttpRequestFilter
Deprecated.UseOpenTelemetryHttpRequesterFilter.Builderinstead.Create a new instance, searching for any instance of an opentelemetry available, using the hostname as the component name.
-
-
Method Details
-
create
Description copied from interface:StreamingHttpClientFilterFactoryCreates aStreamingHttpClientFilterusing the providedStreamingHttpClientFilter.- Specified by:
createin interfaceStreamingHttpClientFilterFactory- Parameters:
client-FilterableStreamingHttpClientto filter- Returns:
StreamingHttpClientFilterusing the providedStreamingHttpClientFilter.
-
create
Description copied from interface:StreamingHttpConnectionFilterFactoryCreate aStreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.- Specified by:
createin interfaceStreamingHttpConnectionFilterFactory- Parameters:
connection-FilterableStreamingHttpConnectionto filter- Returns:
StreamingHttpConnectionFilterusing the providedFilterableStreamingHttpConnection.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencerReturn anExecutionStrategythat describes the offloads required by the influencer.The provided default implementation requests offloading of all operations. Implementations that require no offloading should be careful to return
HttpExecutionStrategies.offloadNone()rather thanHttpExecutionStrategies.offloadNever(). Implementations should avoid returningHttpExecutionStrategies.defaultStrategy(), instead returning the strategy they require orHttpExecutionStrategies.offloadAll()if offloading for all paths is required (safe default).- Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>- Specified by:
requiredOffloadsin interfaceHttpExecutionStrategyInfluencer- Returns:
- the
ExecutionStrategyrequired by the influencer.
-
OpenTelemetryHttpRequesterFilter.Builderinstead.