#[non_exhaustive]pub enum EncoderConfig {
PrometheusText {
precision: Option<u8>,
},
InfluxLineProtocol {
field_key: Option<String>,
precision: Option<u8>,
},
JsonLines {
precision: Option<u8>,
},
Syslog {
hostname: Option<String>,
app_name: Option<String>,
},
RemoteWriteDisabled {},
OtlpDisabled {},
}Expand description
Configuration selecting which encoder to use for a scenario.
This enum is serde-deserializable from YAML scenario files.
The type field selects the variant: prometheus_text, influx_lp,
json_lines, syslog, remote_write, or otlp.
Feature-gated encoders (remote_write, otlp) have companion
*Disabled variants that are compiled in when their feature is absent.
These accept the YAML tag so that deserialization succeeds with a
descriptive error from create_encoder instead of a generic
“unknown variant” error from serde.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PrometheusText
Prometheus text exposition format (version 0.0.4).
precision optionally limits the number of decimal places in metric values.
Fields
InfluxLineProtocol
InfluxDB line protocol.
field_key sets the field key used for the metric value. Defaults to "value".
precision optionally limits the number of decimal places in metric values.
Fields
JsonLines
JSON Lines (NDJSON) format.
Each event is serialized as one JSON object per line. Compatible with Elasticsearch, Loki, and generic HTTP ingest endpoints.
precision optionally rounds the metric value before JSON serialization.
Fields
Syslog
RFC 5424 syslog format.
Encodes log events as syslog lines. hostname and app_name default to "sonda".
Fields
RemoteWriteDisabled
Placeholder variant when the remote-write feature is not compiled in.
Deserializes the remote_write YAML tag so that the error message can
point the user at the missing feature flag instead of producing a
generic “unknown variant” error from serde.
OtlpDisabled
Placeholder variant when the otlp feature is not compiled in.
Deserializes the otlp YAML tag so that the error message can
point the user at the missing feature flag instead of producing a
generic “unknown variant” error from serde.
Trait Implementations§
Source§impl Clone for EncoderConfig
impl Clone for EncoderConfig
Source§fn clone(&self) -> EncoderConfig
fn clone(&self) -> EncoderConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more