pub trait MeterCore: Debug {
// Required methods
fn record_batch_with_context(
&self,
cx: &Context,
attributes: &[KeyValue],
measurements: Vec<Measurement>,
);
fn new_sync_instrument(
&self,
descriptor: Descriptor,
) -> Result<Arc<dyn SyncInstrumentCore>>;
fn new_async_instrument(
&self,
descriptor: Descriptor,
runner: Option<AsyncRunner>,
) -> Result<Arc<dyn AsyncInstrumentCore>>;
fn new_batch_observer(&self, runner: AsyncRunner) -> Result<()>;
}
Available on crate feature
metrics
only.Expand description
The interface an SDK must implement to supply a Meter implementation.
Required Methods§
Sourcefn record_batch_with_context(
&self,
cx: &Context,
attributes: &[KeyValue],
measurements: Vec<Measurement>,
)
fn record_batch_with_context( &self, cx: &Context, attributes: &[KeyValue], measurements: Vec<Measurement>, )
Atomically record a batch of measurements.
Sourcefn new_sync_instrument(
&self,
descriptor: Descriptor,
) -> Result<Arc<dyn SyncInstrumentCore>>
fn new_sync_instrument( &self, descriptor: Descriptor, ) -> Result<Arc<dyn SyncInstrumentCore>>
Create a new synchronous instrument implementation.
Sourcefn new_async_instrument(
&self,
descriptor: Descriptor,
runner: Option<AsyncRunner>,
) -> Result<Arc<dyn AsyncInstrumentCore>>
fn new_async_instrument( &self, descriptor: Descriptor, runner: Option<AsyncRunner>, ) -> Result<Arc<dyn AsyncInstrumentCore>>
Create a new asynchronous instrument implementation.
Runner is None
if used in batch as the batch runner is registered separately.
Sourcefn new_batch_observer(&self, runner: AsyncRunner) -> Result<()>
fn new_batch_observer(&self, runner: AsyncRunner) -> Result<()>
Register a batch observer