Expand description
Bounded decoding of chunk payloads.
A chunk payload declares how many buckets and samples it contains. Those
numbers come straight from the file, so a corrupt or hostile chunk could
otherwise make the decoder allocate hundreds of megabytes for a 100-byte
record. DecodeLimits caps the four things a payload controls:
| Limit | What it bounds |
|---|---|
max_buckets | positive + negative buckets of one histogram |
max_spans | span entries of one histogram layout |
max_custom_values | custom bucket bounds |
max_samples | samples in one chunk |
The defaults are generous enough for anything Prometheus writes (a chunk holds at most 120 samples and at most a few thousand buckets) and small enough that a hostile payload fails immediately instead of exhausting memory.
Structsยง
- Decode
Limits - Caps applied while decoding one chunk.