Class TracingObserver
java.lang.Object
io.helidon.webserver.observe.tracing.TracingObserver
- All Implemented Interfaces:
RuntimeType.Api<TracingObserverConfig>,NamedService,Observer
public class TracingObserver
extends Object
implements Observer, RuntimeType.Api<TracingObserverConfig>
Observer that registers tracing endpoint, and collects all tracing checks.
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create a new builder to configure Tracing observer.static TracingObserverCreate a tracing observer that is enabled for all paths and spans (that are enabled by default).static TracingObserverCreate a new tracing observer based onConfig.static TracingObservercreate(TracingObserverConfig config) Create a new Tracing observer using the provided configuration.static TracingObservercreate(Consumer<TracingObserverConfig.Builder> consumer) Create a new Tracing observer customizing its configuration.Configuration of this observer.voidregister(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction) Register the observer features, services, and/or filters.type()Type of this observer, to make sure we do not configure an observer both fromServiceLoaderand using programmatic approach.
-
Method Details
-
builder
Create a new builder to configure Tracing observer.- Returns:
- a new builder
-
create
Create a tracing observer that is enabled for all paths and spans (that are enabled by default).- Parameters:
tracer- tracer to use for tracing spans created by this feature- Returns:
- tracing observer to register with
ObserveFeature}
-
create
Create a new tracing observer based onConfig.- Parameters:
tracer- tracer to use for tracing spans created by this featureconfig- to base this observer on- Returns:
- a new tracing observer to register with
ObserveFeature
-
create
Create a new Tracing observer using the provided configuration.- Parameters:
config- configuration- Returns:
- a new observer
-
create
Create a new Tracing observer customizing its configuration.- Parameters:
consumer- configuration consumer- Returns:
- a new observer
-
register
public void register(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction) Description copied from interface:ObserverRegister the observer features, services, and/or filters. This is used by the observe feature. Do NOT use this method directly, kindly start withObserveFeatureand register it with the server builder.Implementations of observers should register all they need through an
HttpFeature, to make sure the weight of theObserveFeatureis honored when routing is set up. If you do not use an HttpFeature, the registration will always happen later than the default (business) routing feature.- Specified by:
registerin interfaceObserver- Parameters:
featureContext- access to all routing builders, for cases where this observer needs to register additional components to other socketsobserveEndpointRouting- routing builders that expose observability endpoints, and this feature must use these to register any endpoints exposed for observabilityendpointFunction- function to obtain the final endpoint for observers that expose observe endpoints (such as/observe/healthwould be provider forhealthby default)
-
type
Description copied from interface:ObserverType of this observer, to make sure we do not configure an observer both fromServiceLoaderand using programmatic approach. If it is desired to have more than one observer of the same type, always use programmatic approach- Specified by:
typein interfaceNamedService- Specified by:
typein interfaceObserver- Returns:
- type of this observer, should match
ObserveProvider.type()
-
prototype
Description copied from interface:ObserverConfiguration of this observer.- Specified by:
prototypein interfaceObserver- Specified by:
prototypein interfaceRuntimeType.Api<TracingObserverConfig>- Returns:
- configuration of the observer
-