/** * Attribute-capping primitives shared by the telemetry emit paths: the per-value/bag/total size * caps and the value truncator. Caps bound the per-record OTLP log-record / span attribute size. */ /** Per-value character cap; longer values are truncated with {@link TRUNCATE_MARKER}. */ export declare const MAX_ATTR_VALUE_CHARS = 4096; /** Max keys flattened out of a single open bag, bounding key cardinality from an unbounded bag. */ export declare const MAX_BAG_KEYS = 64; /** Total character budget across one row's attribute map — the total-attr guard. */ export declare const MAX_TOTAL_ATTR_CHARS = 65536; /** Truncate a value past the per-value cap, marking it so the cut is visible downstream. */ export declare function capValue(value: string, max: number): string; /** The outcome of {@link jsonUnderCap}: the JSON when it fits, plus why it does not when it doesn't. */ export interface CappedJson { /** The value's JSON — present only when it serialized AND fits the per-value cap. */ readonly json?: string; /** The value serialized, but its JSON is over the cap and is therefore withheld whole. */ readonly truncated: boolean; /** The JSON's length whenever the value serialized at all — what a drop can be reported by. */ readonly chars?: number; } /** * Serialize a value to JSON for ONE attribute, whole or not at all: a JSON string cut at the * per-value cap is unparseable, so an over-cap value yields no `json` and `truncated: true` rather * than a fragment. A value `JSON.stringify` cannot render (a throwing `toJSON`, a BigInt) — or one * whose `toJSON` returns undefined, which makes stringify return undefined instead of throwing — * yields no `json` and `truncated: false`: nothing was serialized, so nothing was cut. * * Shared by the whole-or-nothing JSON attributes; the shape of the rendered JSON (object vs scalar) * is the caller's contract to check, not this helper's. */ export declare function jsonUnderCap(value: unknown): CappedJson; //# sourceMappingURL=attributes.d.ts.map