Skip to main content

encode_metric_entry

Function encode_metric_entry 

Source
pub fn encode_metric_entry(params: &MetricEntryParams<'_>) -> Vec<u8> 
Expand description

Encode a single MetricEntry FlatBuffer.

MetricEntry table fields (by ID):

  • field 0: metric_type u8
  • field 1: timestamp u64
  • field 2: name string (required)
  • field 3: value double
  • field 4: source string
  • field 5: service string
  • field 6: labels [Label] (vector of tables)
  • field 7: temporality u8
  • field 8: histogram (not yet supported)
  • field 9: session_id [ubyte]
  • field 10: int_labels (not yet supported)

Table layout (after soffset): +4: name offset (u32) +8: source offset (u32) +12: service offset (u32) +16: labels offset (u32) +20: int_labels offset (u32) — always 0 +24: histogram offset (u32) — always 0 +28: session_id offset (u32) +32: timestamp (u64) +40: value (f64) +48: metric_type (u8) +49: temporality (u8) +50-51: padding