Class AutoConfiguredOpenTelemetrySdk
- java.lang.Object
-
- io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk
-
- Direct Known Subclasses:
AutoValue_AutoConfiguredOpenTelemetrySdk
@Immutable public abstract class AutoConfiguredOpenTelemetrySdk extends java.lang.Object
An auto-configured OpenTelemetry SDK. As an alternative to programmatically configuring the SDK usingOpenTelemetrySdk.builder()
, this package can be used to automatically configure the SDK using environment properties specified by OpenTelemetry.- Since:
- 1.28.0
-
-
Constructor Summary
Constructors Constructor Description AutoConfiguredOpenTelemetrySdk()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static AutoConfiguredOpenTelemetrySdkBuilder
builder()
Returns a newAutoConfiguredOpenTelemetrySdkBuilder
which can be used to customize auto-configuration behavior.(package private) static AutoConfiguredOpenTelemetrySdk
create(OpenTelemetrySdk sdk, Resource resource, ConfigProperties config, StructuredConfigProperties structuredConfigProperties)
(package private) abstract ConfigProperties
getConfig()
Returns theConfigProperties
used for auto-configuration, ornull
if declarative configuration was used.abstract OpenTelemetrySdk
getOpenTelemetrySdk()
Returns theOpenTelemetrySdk
that was auto-configured, or an effectively noop instance if the SDK has been disabled.(package private) abstract Resource
getResource()
Returns theResource
that was auto-configured.(package private) abstract StructuredConfigProperties
getStructuredConfig()
Returns theStructuredConfigProperties
used for auto-configuration, ornull
if declarative configuration was not used.static AutoConfiguredOpenTelemetrySdk
initialize()
Returns anAutoConfiguredOpenTelemetrySdk
automatically initialized through recognized system properties and environment variables.
-
-
-
Method Detail
-
initialize
public static AutoConfiguredOpenTelemetrySdk initialize()
Returns anAutoConfiguredOpenTelemetrySdk
automatically initialized through recognized system properties and environment variables.This will automatically set the resulting SDK as the
GlobalOpenTelemetry
instance.
-
builder
public static AutoConfiguredOpenTelemetrySdkBuilder builder()
Returns a newAutoConfiguredOpenTelemetrySdkBuilder
which can be used to customize auto-configuration behavior.
-
create
static AutoConfiguredOpenTelemetrySdk create(OpenTelemetrySdk sdk, Resource resource, @Nullable ConfigProperties config, @Nullable StructuredConfigProperties structuredConfigProperties)
-
getOpenTelemetrySdk
public abstract OpenTelemetrySdk getOpenTelemetrySdk()
Returns theOpenTelemetrySdk
that was auto-configured, or an effectively noop instance if the SDK has been disabled.The instance returned if the SDK is disabled is equivalent to
OpenTelemetrySdk.builder().build()
, which is notably not the same asOpenTelemetry.noop()
.
-
getConfig
@Nullable abstract ConfigProperties getConfig()
Returns theConfigProperties
used for auto-configuration, ornull
if declarative configuration was used.- See Also:
getStructuredConfig()
-
getStructuredConfig
@Nullable abstract StructuredConfigProperties getStructuredConfig()
Returns theStructuredConfigProperties
used for auto-configuration, ornull
if declarative configuration was not used.- See Also:
getConfig()
-
-