import type { OtlpAggregationTemporality, OtlpAttribute, OtlpMetric, OtlpMetricsDocument } from "./types.js"; /** * Flatten an OTLP `KeyValue` attribute array into a plain string record. * * All OTLP value types (string, bool, int, double) are coerced to strings. * Attributes with an absent or unrecognised value are stored as empty strings. * * @param attributes - Optional OTLP attribute array to flatten. * @returns A `Record` mapping each attribute key to its string value. */ export declare function otlpAttributesToRecord(attributes: OtlpAttribute[] | undefined): Record; /** * Parse and minimally validate an OTLP metrics JSON string. * * Validates that the top-level object contains a `resourceMetrics` array. * Throws if the input is not valid JSON or if `resourceMetrics` is absent/not * an array. * * @param input - Raw OTLP metrics JSON string. * @returns The parsed `OtlpMetricsDocument`. */ export declare function parseOtlp(input: string): OtlpMetricsDocument; /** * Determine the data kind of an OTLP metric. * * Supported kinds are `"gauge"`, `"sum"`, and `"histogram"`. * Throws an `Error` if none of those fields are present on the metric. * * @param metric - The OTLP metric to inspect. * @returns `"gauge"`, `"sum"`, or `"histogram"`. */ export declare function getOtlpMetricKind(metric: OtlpMetric): "gauge" | "sum" | "histogram"; /** * Resolve the aggregation temporality for an OTLP sum or histogram metric. * * Maps the raw numeric OTLP enum to a human-readable string: * - `1` → `"delta"` * - `2` → `"cumulative"` * - anything else (including absent) → `"unspecified"` * * @param metric - The OTLP metric to inspect. * @returns The `OtlpAggregationTemporality` string value. */ export declare function getOtlpTemporality(metric: OtlpMetric): OtlpAggregationTemporality; //# sourceMappingURL=parse-otlp.d.ts.map