Class OpenTelemetryHttpServerFilter
java.lang.Object
io.servicetalk.opentelemetry.http.OpenTelemetryHttpServerFilter
- All Implemented Interfaces:
HttpExecutionStrategyInfluencer
,StreamingHttpServiceFilterFactory
,ExecutionStrategyInfluencer<HttpExecutionStrategy>
Deprecated.
A
StreamingHttpService
that supports
open telemetry.
The filter gets a Tracer
with "io.servicetalk" instrumentation scope name.
This filter propagates the OpenTelemetry Context
(thus Span
) so the ordering of filters is crucial.
- Append this filter before others that are expected to see the
Span
for this request/response. - If you want to see the correct
Span
information for auto-drained requests (when a streaming request body was not consumed by the service), add theHttpRequestAutoDrainingServiceFilter
immediately after. - To ensure tracing sees the same result status codes as the calling client, add the
HttpExceptionMapperServiceFilter
after this filter. - If you intend to use a
HttpLifecycleObserver
, add it using the the HttpLifecycleObserverServiceFilter after the tracing filter to ensure the correctSpan
information is present.
HttpServerBuilder.appendNonOffloadingServiceFilter(StreamingHttpServiceFilterFactory)
method for adding these filters as non-offloading filters are always added before offloading filters.-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Create a new instance using theOpenTelemetry
fromGlobalOpenTelemetry.get()
with defaultOpenTelemetryOptions
.OpenTelemetryHttpServerFilter
(io.opentelemetry.api.OpenTelemetry openTelemetry) Deprecated.this method is internal, no user should be setting theOpenTelemetry
as 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.OpenTelemetryHttpServerFilter
(OpenTelemetryOptions openTelemetryOptions) Deprecated.Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(StreamingHttpService service) Create aStreamingHttpServiceFilter
using the providedStreamingHttpService
.final HttpExecutionStrategy
Return anExecutionStrategy
that describes the offloads required by the influencer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy, requiredOffloads
-
Constructor Details
-
OpenTelemetryHttpServerFilter
Deprecated.this method is internal, no user should be setting theOpenTelemetry
as 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. UseOpenTelemetryHttpServerFilter(OpenTelemetryOptions)
orOpenTelemetryHttpServerFilter()
instead.Create a new instance.- Parameters:
openTelemetry
- theOpenTelemetry
.
-
OpenTelemetryHttpServerFilter
public OpenTelemetryHttpServerFilter()Deprecated.Create a new instance using theOpenTelemetry
fromGlobalOpenTelemetry.get()
with defaultOpenTelemetryOptions
. -
OpenTelemetryHttpServerFilter
Deprecated.Create a new instance.- Parameters:
openTelemetryOptions
- extra options to create the opentelemetry filter
-
-
Method Details
-
create
Description copied from interface:StreamingHttpServiceFilterFactory
Create aStreamingHttpServiceFilter
using the providedStreamingHttpService
.- Specified by:
create
in interfaceStreamingHttpServiceFilterFactory
- Parameters:
service
-StreamingHttpService
to filter- Returns:
StreamingHttpServiceFilter
using the providedStreamingHttpService
.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencer
Return anExecutionStrategy
that 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:
requiredOffloads
in interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>
- Specified by:
requiredOffloads
in interfaceHttpExecutionStrategyInfluencer
- Returns:
- the
ExecutionStrategy
required by the influencer.
-
OpenTelemetryHttpServiceFilter
instead.