Skip to content

toProtobuf

toProtobuf(sketch): Uint8Array

Defined in: packages/distillate/src/ddsketch/protobuf/protobuf.ts:413

Encodes a sketch as Datadog’s DDSketch protobuf message, the form the Datadog API and sketches-go read. For a dense or collapsing store the bytes are exactly those sketches-go writes for the same bins.

The message has no fields for sum, min or max, so those do not survive the trip; fromProtobuf derives them from the bins.

DDSketch

The sketch to encode.

Uint8Array

The serialized message.