Class OpenTelemetryMeterRegistryBuilder
java.lang.Object
io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistryBuilder
A builder of
OpenTelemetryMeterRegistry.-
Method Summary
Modifier and TypeMethodDescriptionio.micrometer.core.instrument.MeterRegistrybuild()Returns a newOpenTelemetryMeterRegistrywith the settings of thisOpenTelemetryMeterRegistryBuilder.setBaseTimeUnit(TimeUnit baseTimeUnit) Sets the base time unit.setClock(io.micrometer.core.instrument.Clock clock) Sets a customClock.setPrometheusMode(boolean prometheusMode) Enables the "Prometheus mode" - this will simulate the behavior of Micrometer'sPrometheusMeterRegistry.
-
Method Details
-
setClock
@CanIgnoreReturnValue public OpenTelemetryMeterRegistryBuilder setClock(io.micrometer.core.instrument.Clock clock) Sets a customClock. Useful for testing. -
setBaseTimeUnit
@CanIgnoreReturnValue public OpenTelemetryMeterRegistryBuilder setBaseTimeUnit(TimeUnit baseTimeUnit) Sets the base time unit. -
setPrometheusMode
@CanIgnoreReturnValue public OpenTelemetryMeterRegistryBuilder setPrometheusMode(boolean prometheusMode) Enables the "Prometheus mode" - this will simulate the behavior of Micrometer'sPrometheusMeterRegistry. The instruments will be renamed to match Micrometer instrument naming, and the base time unit will be set to seconds.Set this to
trueif you are using the Prometheus metrics exporter. -
build
public io.micrometer.core.instrument.MeterRegistry build()Returns a newOpenTelemetryMeterRegistrywith the settings of thisOpenTelemetryMeterRegistryBuilder.
-