export type TelemetryAttributeValue = string | number | boolean | readonly (string | number | boolean)[] | undefined; /** Redact and bound text before retaining it or handing it to a provider. */ export declare function sanitizeTelemetryText(value: string, maxLength: number): string; /** Redact a single flattened telemetry attribute. */ export declare function sanitizeTelemetryAttributeValue(key: string, value: TelemetryAttributeValue): TelemetryAttributeValue; /** Return a redacted copy of a flattened telemetry attribute record. */ export declare function sanitizeTelemetryAttributes | undefined>(attributes: T): T; /** * Return a detached, fail-closed snapshot suitable for retained logs and * errors. Credential-like keys and URL credentials are redacted recursively. */ export declare function sanitizeStructuredTelemetryData(value: T): T; /** * Whether a telemetry snapshot keeps the source error's stack. * * `withStack` is for an error that actually unwound through the region being * reported on: its frames describe the failure. `withoutStack` is for an error * built at the reporting site to classify a failure it did not itself raise. * Those frames describe the reporting code, they carry the absolute paths of * whichever machine ran it, and they say nothing about what went wrong, so they * must not leave the process. */ export type TelemetryErrorDetail = "withStack" | "withoutStack"; /** * Create an error safe to send to telemetry backends without mutating or * replacing the application error that will be returned to the caller. * * Native errors are classified through a hook-free runtime brand check. Older * supported runtimes use the platform compatibility implementation instead of * the unsafe `instanceof` fallback that executes Proxy traps. * * Pass `"withoutStack"` when `error` stands in for the failure rather than * being it. The snapshot then has no `stack` at all, which is what keeps * `recordException` from exporting an `exception.stacktrace`. */ export declare function sanitizeErrorForTelemetry(error: unknown, detail?: TelemetryErrorDetail, safeName?: string): Error; /** Whether text names one of the transient network codes above. */ export declare function hasTransientErrorCode(text: string): boolean; /** * Bounded classification safe to put on a span. Never returns the error's own * message: telemetry leaves the process, and a message carries whatever the * thrower interpolated into it. The detail stays in the logs. * * Accepts `unknown` because a throw is not guaranteed to be an `Error`, and a * bare string reaches `sanitizeErrorForTelemetry` as raw text. */ export declare function telemetryErrorType(error: unknown): string; //# sourceMappingURL=telemetry-error.d.ts.map