Skip to main content

Module stats_payload_encoder

Module stats_payload_encoder 

Source
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::ClientGroupedStats entries 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::StatsPayload as msgpack (with named fields), matching the encoding accepted by the /api/v0.2/stats intake.
split_stats_buckets
Split buckets into groups of at most max_entries pb::ClientGroupedStats. An oversized bucket is split across output buckets sharing its start, duration and agent_time_shift. Empty buckets are dropped, so all-empty input yields no groups.