Trait opentelemetry::labels::Encoder [−][src]
pub trait Encoder: Debug { fn encode(&self, labels: &mut dyn Iterator<Item = (&Key, &Value)>) -> String; fn id(&self) -> EncoderId; }
This is supported on crate feature
metrics
only.Encoder is a mechanism for serializing a label set into a specific string representation that supports caching, to avoid repeated serialization. An example could be an exporter encoding the label set into a wire representation.
Required methods
fn encode(&self, labels: &mut dyn Iterator<Item = (&Key, &Value)>) -> String
[src]
Encode returns the serialized encoding of the label set using its Iterator. This result may be cached.
fn id(&self) -> EncoderId
[src]
A value that is unique for each class of label encoder. Label encoders
allocate these using new_encoder_id
.
Implementors
Loading content...