Class ReconfigurableOpenTelemetry
- All Implemented Interfaces:
ExtensionPoint
,ExtendedOpenTelemetry
,io.opentelemetry.api.OpenTelemetry
,Closeable
,AutoCloseable
Reconfigurable OpenTelemetry
.
We need reconfigurability because Jenkins supports changing the configuration of the OpenTelemetry params at runtime.
All instantiated tracers, loggers, and eventLoggers are reconfigured when the configuration changes, when
configure(Map, Resource)
is invoked.
Reconfigurable EventLoggerProvider
that allows to reconfigure the Tracer
s,
Logger
s, and EventLogger
s.
Jenkins components interested in being notified after the OpenTelemetry configuration changes can be marked as @Extension
and implement OpenTelemetryLifecycleListener
.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
configure
(Map<String, String> openTelemetryProperties, io.opentelemetry.sdk.resources.Resource openTelemetryResource) Deprecated.void
configure
(Map<String, String> openTelemetryProperties, io.opentelemetry.sdk.resources.Resource openTelemetryResource, boolean disableShutdownHook) Reconfigures theOpenTelemetry
instance.io.opentelemetry.api.incubator.events.EventLoggerBuilder
eventLoggerBuilder
(String instrumentationScopeName) static ReconfigurableOpenTelemetry
get()
Use a factory method for the @Extension
to ensure single instantiation across Jenkinsio.opentelemetry.sdk.autoconfigure.spi.ConfigProperties
ConfigProperties
used to instantiate this OpenTelemetry instance using theAutoConfiguredOpenTelemetrySdk
.io.opentelemetry.api.incubator.events.EventLoggerProvider
io.opentelemetry.api.OpenTelemetry
Deprecated.io.opentelemetry.sdk.logs.export.LogRecordExporter
For testing and troubleshooting purposeio.opentelemetry.api.logs.LoggerProvider
io.opentelemetry.api.metrics.Meter
io.opentelemetry.api.metrics.MeterProvider
io.opentelemetry.context.propagation.ContextPropagators
io.opentelemetry.sdk.resources.Resource
Resource
used by this OpenTelemetry instance for the resource attributes of the produced telemetryio.opentelemetry.api.trace.Tracer
io.opentelemetry.api.trace.Tracer
io.opentelemetry.api.trace.TracerProvider
static void
init()
io.opentelemetry.api.metrics.MeterBuilder
meterBuilder
(String instrumentationScopeName) protected void
protected void
setOpenTelemetryImpl
(io.opentelemetry.api.OpenTelemetry openTelemetryImpl) io.opentelemetry.api.trace.TracerBuilder
tracerBuilder
(String instrumentationScopeName)
-
Constructor Details
-
ReconfigurableOpenTelemetry
public ReconfigurableOpenTelemetry()Initialize as NoOp.
- See Also:
-
-
Method Details
-
init
-
get
Use a factory method for the @Extension
to ensure single instantiation across JenkinsThe Jenkins component
ReconfigurableOpenTelemetry
is instantiated through the static factory methodget()
rather than through the instance constructor to ensure that we have single instantiation across Jenkins' @Extension
and Google Guice @Inject
.This factory method works in conjunction with
OpenTelemetryApiGuiceModule
-
configure
@Deprecated public void configure(@NonNull Map<String, String> openTelemetryProperties, io.opentelemetry.sdk.resources.Resource openTelemetryResource) Deprecated.useconfigure(Map, Resource, boolean)
insteadConfigure the OpenTelemetry SDK with the given properties and resource disabling the OTel SDK shutdown hook- Specified by:
configure
in interfaceExtendedOpenTelemetry
-
configure
public void configure(@NonNull Map<String, String> openTelemetryProperties, io.opentelemetry.sdk.resources.Resource openTelemetryResource, boolean disableShutdownHook) Description copied from interface:ExtendedOpenTelemetry
Reconfigures theOpenTelemetry
instance. If no exporter is explicitly defined, this OpenTelemetry instance is NoOp.- Specified by:
configure
in interfaceExtendedOpenTelemetry
- Parameters:
openTelemetryProperties
- properties used asConfigProperties
throughAutoConfiguredOpenTelemetrySdkBuilder.addPropertiesSupplier(Supplier)
openTelemetryResource
- resource attributes passed throughAutoConfiguredOpenTelemetrySdkBuilder.addResourceCustomizer(BiFunction)
disableShutdownHook
- enable / disable a shutdown hook
-
setOpenTelemetryImpl
protected void setOpenTelemetryImpl(io.opentelemetry.api.OpenTelemetry openTelemetryImpl) -
close
@PreDestroy public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getTracerProvider
public io.opentelemetry.api.trace.TracerProvider getTracerProvider()- Specified by:
getTracerProvider
in interfaceio.opentelemetry.api.OpenTelemetry
-
getTracer
- Specified by:
getTracer
in interfaceio.opentelemetry.api.OpenTelemetry
-
getTracer
public io.opentelemetry.api.trace.Tracer getTracer(String instrumentationScopeName, String instrumentationScopeVersion) - Specified by:
getTracer
in interfaceio.opentelemetry.api.OpenTelemetry
-
tracerBuilder
- Specified by:
tracerBuilder
in interfaceio.opentelemetry.api.OpenTelemetry
-
getMeterProvider
public io.opentelemetry.api.metrics.MeterProvider getMeterProvider()- Specified by:
getMeterProvider
in interfaceio.opentelemetry.api.OpenTelemetry
-
getEventLoggerProvider
public io.opentelemetry.api.incubator.events.EventLoggerProvider getEventLoggerProvider()- Specified by:
getEventLoggerProvider
in interfaceExtendedOpenTelemetry
-
eventLoggerBuilder
public io.opentelemetry.api.incubator.events.EventLoggerBuilder eventLoggerBuilder(String instrumentationScopeName) - Specified by:
eventLoggerBuilder
in interfaceExtendedOpenTelemetry
-
getMeter
- Specified by:
getMeter
in interfaceio.opentelemetry.api.OpenTelemetry
-
meterBuilder
- Specified by:
meterBuilder
in interfaceio.opentelemetry.api.OpenTelemetry
-
getImplementation
Deprecated.- Specified by:
getImplementation
in interfaceExtendedOpenTelemetry
-
getResource
@NonNull public io.opentelemetry.sdk.resources.Resource getResource()Description copied from interface:ExtendedOpenTelemetry
Resource
used by this OpenTelemetry instance for the resource attributes of the produced telemetry- Specified by:
getResource
in interfaceExtendedOpenTelemetry
-
getConfig
@NonNull public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties getConfig()Description copied from interface:ExtendedOpenTelemetry
ConfigProperties
used to instantiate this OpenTelemetry instance using theAutoConfiguredOpenTelemetrySdk
.- Specified by:
getConfig
in interfaceExtendedOpenTelemetry
-
getLogsBridge
public io.opentelemetry.api.logs.LoggerProvider getLogsBridge()- Specified by:
getLogsBridge
in interfaceio.opentelemetry.api.OpenTelemetry
-
getPropagators
public io.opentelemetry.context.propagation.ContextPropagators getPropagators()- Specified by:
getPropagators
in interfaceio.opentelemetry.api.OpenTelemetry
-
getLogRecordExporter
public io.opentelemetry.sdk.logs.export.LogRecordExporter getLogRecordExporter()For testing and troubleshooting purpose -
postOpenTelemetrySdkConfiguration
@OverridingMethodsMustInvokeSuper protected void postOpenTelemetrySdkConfiguration()
-
configure(Map, Resource, boolean)
instead