Skip to content

Packet Format

Messages are defined in Protocol Buffers in src/metrics/proto/metrics.proto.

message Metric {
  string name = 1;
  Kind kind = 2;            // GAUGE = 0, COUNTER = 1
  double value = 3;
  int64 ts_ms = 4;
  string block_id = 5;
  string unit = 6;
  map<string, string> labels = 7;
}

message Batch {
  string id = 1;
  string node_id = 2;
  string cluster_id = 3;
  int64 created_at_ms = 4;
  repeated Metric metrics = 5;
}

message Packet {
  bytes body = 1;           // serialized Batch
  bytes hash = 2;           // SHA-256 of body
  string pubkey = 3;
  bytes signature = 4;
}
Service Method Port
Ingest Push(Packet) returns (PushReply) 50051
Health Ping(PingRequest) returns (PingReply) 50052

Signature

The signature is a Schnorr signature on secp256k1. Packets and pings use separate signing domains, dgrid-metrics-packet-v1 and dgrid-metrics-ping-v1, so a signature of one can never be used as the other.

Limits

Item Limit
Body 1 MiB
Metrics in a batch 5000
Nonce of a ping 16 to 128 characters

queued: true means that the packet is in the aggregator's durable queue. Signature, authorization and duplicates are checked when it is processed. The outcomes are counted in GET /v1/stats.