Skip to main content

Crate metrique_writer_core

Crate metrique_writer_core 

Source
Expand description

This crate contains core trait and struct definitions for metrique-writer, to allow for compatibility between (future) different major versions of metrique-writer. You should be using metrique-writer directly rather than this crate.

Re-exports§

pub use crate::entry::BoxEntry;
pub use crate::entry::Entry;
pub use crate::entry::EntryConfig;
pub use crate::entry::EntryWriter;
pub use crate::global::GlobalEntrySink;
pub use crate::sample::SampleGroup;
pub use crate::sink::AnyEntrySink;
pub use crate::sink::BoxEntrySink;
pub use crate::sink::EntrySink;
pub use crate::stream::EntryIoStream;
pub use crate::stream::IoStreamError;
pub use crate::unit::Convert;
pub use crate::unit::Unit;
pub use crate::value::Distribution;
pub use crate::value::MetricFlags;
pub use crate::value::MetricValue;
pub use crate::value::Observation;
pub use crate::value::Value;
pub use crate::value::ValueWriter;

Modules§

config
Contains configurations that are mostly useful for EMF-format metrics
entry
This module contains the Entry trait, which represents an entry that can be written to an EntryWriter in order to emit metrics
format
Contains the Format trait.
global
Contains the global_entry_sink macro, which can be used to define GlobalEntrySinks which are a rendezvous points between metric sources and metric sinks.
sample
Defines the SampledFormat trait, which allows for formats that can be sampled.
sink
Contains the EntrySink trait, which provides sinks into which metric entries can be written. Unlike EntryIoStream, these can be asynchronous.
stream
Contains the EntryIoStream trait, which writes entries to a destination synchronously.
unit
Contains utilities for attaching Units (such as percents, kilobytes, or seconds) to metrics. Conversion between different units is handled by Convert.
value
A Value is something that can be written to a given metric field.

Macros§

global_entry_sink
Define a new global AttachGlobalEntrySink that can be referenced by type name in all threads.

Structs§

ValidationError
An error type that describes why an crate::Entry isn’t valid. This can be because it violated general contracts (e.g. writing multiple values with the same name) or because it violated a format-specific contract (e.g. using a reserved property name).
ValidationErrorBuilder
Builder to record validation failures over time and bundle them into a single ValidationError Note that if no validation failures are added to the builder, ValidationErrorBuilder::build() will return None, which is useful to track if a side-effect produced any errors.