PayloadChunking Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Heuristic span size estimation and byte-level chunking for OTLP/HTTP JSON payloads.
The Agent 365 OTLP traces endpoint enforces a 1 MB request body limit. Per-span truncation (250 KB cap inside ExportFormatter) prevents any single span from being too large; this class provides the second layer of defense at the batch level by splitting batches into sub-batches whose cumulative estimated size stays under MaxPayloadBytes.
public static class PayloadChunking
type PayloadChunking = class
Public Class PayloadChunking
- Inheritance
-
PayloadChunking
Methods
| Name | Description |
|---|---|
| ChunkBySize<T>(IEnumerable<T>, Func<T,Int64>, Int64) |
Splits items into sub-batches whose cumulative estimated size stays under
Invariants:
|
| EstimateActivityBytes(Activity) |
Heuristic estimator for the serialized size of an OTLP span produced from the supplied Activity when emitted as OTLP/HTTP JSON. Uses generous constants tuned to over-estimate by ~25-50%, providing headroom for JSON serializer variance (whitespace, enum representation, integer-as-string). |
| EstimateValueBytes(Object) |
Estimates the serialized byte size of a single attribute value in OTLP/HTTP JSON. |