Struct opentelemetry::sdk::metrics::controllers::BasicControllerBuilder
source · [−]pub struct BasicControllerBuilder { /* private fields */ }
metrics
only.Expand description
Options for configuring a BasicController
Implementations
sourceimpl 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 collect.In a pull-only configuration, collection is performed on demand; set this to
0` to always recompute the export record set.
When exporting metrics, this must be > 0.
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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for BasicControllerBuilder
impl Send for BasicControllerBuilder
impl Sync for BasicControllerBuilder
impl Unpin for BasicControllerBuilder
impl !UnwindSafe for BasicControllerBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more