PayloadChunking.EstimateActivityBytes(Activity) Method

Definition

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).

public static long EstimateActivityBytes(System.Diagnostics.Activity activity);
static member EstimateActivityBytes : System.Diagnostics.Activity -> int64
Public Shared Function EstimateActivityBytes (activity As Activity) As Long

Parameters

activity
Activity

The activity to estimate.

Returns

An over-estimate of the serialized OTLP span size in bytes.

Applies to