Struct opentelemetry::sdk::metrics::controllers::BasicControllerBuilder
source · pub struct BasicControllerBuilder { /* private fields */ }
metrics
only.Expand description
Options for configuring a BasicController
Implementations§
source§impl BasicControllerBuilder
impl BasicControllerBuilder
sourcepub fn with_resource(self, resource: Resource) -> BasicControllerBuilder
pub fn with_resource(self, resource: Resource) -> BasicControllerBuilder
Sets the Resource
used for this controller.
sourcepub fn with_exporter(
self,
exporter: impl MetricsExporter + Send + Sync + 'static
) -> BasicControllerBuilder
pub fn with_exporter( self, exporter: impl MetricsExporter + Send + Sync + 'static ) -> BasicControllerBuilder
Sets the exporter used for exporting metric data.
Note: Exporters such as Prometheus that pull data do not implement
MetricsExporter
. They will directly call collect
and try_for_each
.
sourcepub fn with_collect_period(
self,
collect_period: Duration
) -> BasicControllerBuilder
pub fn with_collect_period( self, collect_period: Duration ) -> BasicControllerBuilder
Sets the interval between calls to collect
a checkpoint.
When pulling metrics and not exporting, this is the minimum time between
calls to a pull-only configuration, collection is performed on
demand; set this to 0
to always collect.
When exporting metrics, this must be > 0s.
Default value is 10s.
sourcepub fn with_collect_timeout(
self,
collect_timeout: Duration
) -> BasicControllerBuilder
pub fn with_collect_timeout( self, collect_timeout: Duration ) -> BasicControllerBuilder
Sets the timeout of the collect
and subsequent observer instrument
callbacks.
Default value is 10s. If zero or none, no collect timeout is applied.
sourcepub fn with_push_timeout(self, push_timeout: Duration) -> BasicControllerBuilder
pub fn with_push_timeout(self, push_timeout: Duration) -> BasicControllerBuilder
Sets push controller timeout when a exporter is configured.
Default value is 10s. If zero, no export timeout is applied.
sourcepub fn build(self) -> BasicController
pub fn build(self) -> BasicController
Creates a new basic controller.