- All Superinterfaces:
NamedService
- All Known Implementing Classes:
ConfigObserver,HealthObserver,InfoObserver,LogObserver,MetricsObserver,TracingObserver
An observer adds observability feature to Helidon
ObserveFeature,
such as health, metrics.
An observer may register features, services, filters on routing, or do some other magic that is related to observability. Some observers may expose endpoints, some may use a push approach.
Configuration of an observer is located under observe.observer root configuration node, with
ObserveProvider.configKey() key below it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Stringname()Name of this implementation, as provided inConfiguredProvider.create(Config, String).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
-
prototype
ObserverConfigBase prototype()Configuration of this observer.- Returns:
- configuration of the observer
-
type
String type()Type 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- Returns:
- type of this observer, should match
ObserveProvider.type()
-
name
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(Config, String).- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
register
void register(ServerFeature.ServerFeatureContext featureContext, List<HttpRouting.Builder> observeEndpointRouting, UnaryOperator<String> endpointFunction) Register 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.- 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)
-