Comment by jcgrillo
Comment by jcgrillo 15 hours ago
Why do all these things use such damnably inefficient wire formats?
For metrics, we're shipping a bunch of numbers over the wire, with some string tags. So why not something like:
message Measurements {
uint32 metric_id = 1;
uint64 t0_seconds = 2;
uint32 t0_nanoseconds = 3;
repeated uint64 delta_nanoseconds [packed = true] = 4;
repeated int64 values [packed = true] = 5;
}
Where delta_nanoseconds represents a series of deltas from timestamp t0 and values has the same length as delta_nanoseconds. Tags could be sent separately: message Tags {
uint32 metric_id = 1;
repeated string tags = 2;
}
That way you only have to send the tags if they change and the values are encoded efficiently. I bet you could have really nice granular monitoring e.g. sub ms precision quite cheaply this way.Obviously there are further optimizations we can make if e.g. we know the values will respond nicely to delta encoding.
You may be interested in this: https://github.com/open-telemetry/otel-arrow#benchmark-summa...