Package io.helidon.telemetry.otelconfig
Class OpenTelemetryConfig.BuilderBase<BUILDER extends OpenTelemetryConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenTelemetryConfig>
java.lang.Object
io.helidon.telemetry.otelconfig.OpenTelemetryConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
OpenTelemetryConfig.Builder
- Enclosing interface:
OpenTelemetryConfig
public abstract static class OpenTelemetryConfig.BuilderBase<BUILDER extends OpenTelemetryConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends OpenTelemetryConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
HelidonOpenTelemetry.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPropagator(io.opentelemetry.context.propagation.TextMapPropagator propagator) OpenTelemetryTextMapPropagatorinstances added explicitly by the app.addPropagators(List<? extends io.opentelemetry.context.propagation.TextMapPropagator> propagators) OpenTelemetryTextMapPropagatorinstances added explicitly by the app.Clear existing value of this property.config()If this instance was configured, this would be the config instance used.Deprecated.Update builder from configuration (node of this type).booleanenabled()Whether the OpenTelemetry support is enabled.enabled(boolean enabled) Whether the OpenTelemetry support is enabled.from(OpenTelemetryConfig prototype) Update this builder from an existing prototype instance.from(OpenTelemetryConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.booleanglobal()Whether theOpenTelemetryinstance created from this configuration should be made the global one.global(boolean global) Whether theOpenTelemetryinstance created from this configuration should be made the global one.Optional<io.opentelemetry.api.OpenTelemetry> TheOpenTelemetryinstance to use for telemetry.openTelemetry(io.opentelemetry.api.OpenTelemetry openTelemetry) TheOpenTelemetryinstance to use for telemetry.protected voidHandles providers and decorators.List<io.opentelemetry.context.propagation.TextMapPropagator> OpenTelemetryTextMapPropagatorinstances added explicitly by the app.propagators(List<? extends io.opentelemetry.context.propagation.TextMapPropagator> propagators) OpenTelemetryTextMapPropagatorinstances added explicitly by the app.service()Service name used in sending telemetry data to the collector.Service name used in sending telemetry data to the collector.toString()Optional<io.opentelemetry.api.trace.TracerProvider> Sets the tracer provider that OpenTelemetry should use.tracerProvider(io.opentelemetry.api.trace.TracerProvider tracerProvider) Sets the tracer provider that OpenTelemetry should use.protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends OpenTelemetryConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends OpenTelemetryConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends OpenTelemetryConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends OpenTelemetryConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
service
Service name used in sending telemetry data to the collector.- Parameters:
service- service name- Returns:
- updated builder instance
- See Also:
-
enabled
Whether the OpenTelemetry support is enabled.- Parameters:
enabled- true if enabled; false otherwise- Returns:
- updated builder instance
- See Also:
-
global
Whether theOpenTelemetryinstance created from this configuration should be made the global one.- Parameters:
global- true if the configured instance should be made global; false otherwise- Returns:
- updated builder instance
- See Also:
-
propagators
public BUILDER propagators(List<? extends io.opentelemetry.context.propagation.TextMapPropagator> propagators) OpenTelemetryTextMapPropagatorinstances added explicitly by the app.Default: "tracecontext,baggage".
- Parameters:
propagators- propagators- Returns:
- updated builder instance
- See Also:
-
addPropagators
public BUILDER addPropagators(List<? extends io.opentelemetry.context.propagation.TextMapPropagator> propagators) OpenTelemetryTextMapPropagatorinstances added explicitly by the app.Default: "tracecontext,baggage".
- Parameters:
propagators- propagators- Returns:
- updated builder instance
- See Also:
-
addPropagator
OpenTelemetryTextMapPropagatorinstances added explicitly by the app.Default: "tracecontext,baggage".
- Parameters:
propagator- propagators- Returns:
- updated builder instance
- See Also:
-
clearTracerProvider
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
tracerProvider
Sets the tracer provider that OpenTelemetry should use.- Parameters:
tracerProvider- OpenTelemetry tracer provider- Returns:
- updated builder instance
- See Also:
-
openTelemetry
TheOpenTelemetryinstance to use for telemetry.Typically, this value will be the OpenTelemetry SDK instance created using this configuration, but if some other code (such as the OpenTelemetry agent) has already set the OTel global instance, this value will be that global instance.
- Parameters:
openTelemetry- the OpenTelemetry instance- Returns:
- updated builder instance
- See Also:
-
service
Service name used in sending telemetry data to the collector.- Returns:
- the service
-
enabled
public boolean enabled()Whether the OpenTelemetry support is enabled.- Returns:
- the enabled
-
global
public boolean global()Whether theOpenTelemetryinstance created from this configuration should be made the global one.- Returns:
- the global
-
propagators
OpenTelemetryTextMapPropagatorinstances added explicitly by the app.Default: "tracecontext,baggage".
- Returns:
- the propagators
- See Also:
-
tracerProvider
Sets the tracer provider that OpenTelemetry should use.- Returns:
- the tracer provider
-
openTelemetry
TheOpenTelemetryinstance to use for telemetry.Typically, this value will be the OpenTelemetry SDK instance created using this configuration, but if some other code (such as the OpenTelemetry agent) has already set the OTel global instance, this value will be that global instance.
- Returns:
- the open telemetry
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
config(io.helidon.config.Config)