Class PrometheusHttpServerBuilder
java.lang.Object
io.opentelemetry.exporter.prometheus.PrometheusHttpServerBuilder
A builder for
PrometheusHttpServer
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a newPrometheusHttpServer
with the configuration of this builder which can be registered with aSdkMeterProvider
.setExecutor
(ExecutorService executor) Sets theExecutorService
to be used forPrometheusHttpServer
.Sets the host to bind to.setOtelScopeEnabled
(boolean otelScopeEnabled) Set if theotel_scope_*
attributes are generated.setPort
(int port) Sets the port to bind to.setPrometheusRegistry
(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry) Sets thePrometheusRegistry
to be used forPrometheusHttpServer
.
-
Method Details
-
setHost
Sets the host to bind to. If unset, defaults to "0.0.0.0". -
setPort
Sets the port to bind to. If unset, defaults to 9464. -
setExecutor
Sets theExecutorService
to be used forPrometheusHttpServer
. -
setPrometheusRegistry
public PrometheusHttpServerBuilder setPrometheusRegistry(io.prometheus.metrics.model.registry.PrometheusRegistry prometheusRegistry) Sets thePrometheusRegistry
to be used forPrometheusHttpServer
. -
setOtelScopeEnabled
Set if theotel_scope_*
attributes are generated. Default istrue
. -
build
Returns a newPrometheusHttpServer
with the configuration of this builder which can be registered with aSdkMeterProvider
.
-