Expand description
Encoding utilities for the top-level pb::StatsPayload message.
Wraps a pb::ClientStatsPayload into a pb::StatsPayload and serializes
it as msgpack, matching the Agent’s /api/v0.2/stats wire format. Payloads
over MAX_GROUPED_STATS_PER_PAYLOAD entries are split via
split_stats_buckets and sent one per group.
Constants§
- MAX_
GROUPED_ STATS_ PER_ PAYLOAD - Max
pb::ClientGroupedStatsentries per stats payload before splitting, matching the Agent (pkg/trace/writer/stats.go).
Functions§
- build_
stats_ payload - Wrap a client stats payload into a top-level
pb::StatsPayload. - encode_
stats_ payload_ msgpack - Serialize a
pb::StatsPayloadas msgpack (with named fields), matching the encoding accepted by the/api/v0.2/statsintake. - split_
stats_ buckets - Split buckets into groups of at most
max_entriespb::ClientGroupedStats. An oversized bucket is split across output buckets sharing itsstart,durationandagent_time_shift. Empty buckets are dropped, so all-empty input yields no groups.