@hue-run/sdk 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CLI.md +246 -52
  2. package/README.md +54 -13
  3. package/WORLDS.md +6 -3
  4. package/dist/ai-sdk.d.ts +23 -1
  5. package/dist/ai-sdk.js +60 -2
  6. package/dist/cli/import-formats/adapter.d.ts +80 -0
  7. package/dist/cli/import-formats/adapter.js +1 -0
  8. package/dist/cli/import-formats/agent-events.d.ts +5 -0
  9. package/dist/cli/import-formats/agent-events.js +16 -0
  10. package/dist/cli/import-formats/atif.d.ts +3 -0
  11. package/dist/cli/import-formats/atif.js +15 -0
  12. package/dist/cli/import-formats/braintrust.d.ts +2 -0
  13. package/dist/cli/import-formats/braintrust.js +222 -0
  14. package/dist/cli/import-formats/containers.d.ts +32 -0
  15. package/dist/cli/import-formats/containers.js +399 -0
  16. package/dist/cli/import-formats/datadog.d.ts +2 -0
  17. package/dist/cli/import-formats/datadog.js +264 -0
  18. package/dist/cli/import-formats/helicone.d.ts +2 -0
  19. package/dist/cli/import-formats/helicone.js +161 -0
  20. package/dist/cli/import-formats/identity.d.ts +112 -0
  21. package/dist/cli/import-formats/identity.js +594 -0
  22. package/dist/cli/import-formats/jaeger.d.ts +3 -0
  23. package/dist/cli/import-formats/jaeger.js +266 -0
  24. package/dist/cli/import-formats/langfuse.d.ts +7 -0
  25. package/dist/cli/import-formats/langfuse.js +510 -0
  26. package/dist/cli/import-formats/langsmith.d.ts +2 -0
  27. package/dist/cli/import-formats/langsmith.js +244 -0
  28. package/dist/cli/import-formats/messages.d.ts +28 -0
  29. package/dist/cli/import-formats/messages.js +301 -0
  30. package/dist/cli/import-formats/mlflow.d.ts +2 -0
  31. package/dist/cli/import-formats/mlflow.js +260 -0
  32. package/dist/cli/import-formats/openai-agents.d.ts +2 -0
  33. package/dist/cli/import-formats/openai-agents.js +221 -0
  34. package/dist/cli/import-formats/opik.d.ts +2 -0
  35. package/dist/cli/import-formats/opik.js +193 -0
  36. package/dist/cli/import-formats/otel-family.d.ts +5 -0
  37. package/dist/cli/import-formats/otel-family.js +17 -0
  38. package/dist/cli/import-formats/otel-spans.d.ts +94 -0
  39. package/dist/cli/import-formats/otel-spans.js +262 -0
  40. package/dist/cli/import-formats/otlp-protobuf.d.ts +35 -0
  41. package/dist/cli/import-formats/otlp-protobuf.js +486 -0
  42. package/dist/cli/import-formats/otlp.d.ts +4 -0
  43. package/dist/cli/import-formats/otlp.js +15 -0
  44. package/dist/cli/import-formats/phoenix.d.ts +3 -0
  45. package/dist/cli/import-formats/phoenix.js +256 -0
  46. package/dist/cli/import-formats/raindrop.d.ts +21 -0
  47. package/dist/cli/import-formats/raindrop.js +255 -0
  48. package/dist/cli/import-formats/reader.d.ts +56 -0
  49. package/dist/cli/import-formats/reader.js +364 -0
  50. package/dist/cli/import-formats/registry.d.ts +36 -0
  51. package/dist/cli/import-formats/registry.js +71 -0
  52. package/dist/cli/import-formats/row-platform-fields.d.ts +32 -0
  53. package/dist/cli/import-formats/row-platform-fields.js +76 -0
  54. package/dist/cli/import-formats/rows.d.ts +165 -0
  55. package/dist/cli/import-formats/rows.js +638 -0
  56. package/dist/cli/import-formats/transcripts.d.ts +25 -0
  57. package/dist/cli/import-formats/transcripts.js +498 -0
  58. package/dist/cli/import-formats/weave.d.ts +2 -0
  59. package/dist/cli/import-formats/weave.js +159 -0
  60. package/dist/cli/import-formats/zipkin.d.ts +2 -0
  61. package/dist/cli/import-formats/zipkin.js +219 -0
  62. package/dist/cli/import.d.ts +1 -1
  63. package/dist/cli/import.js +4 -2
  64. package/dist/cli/traces-import-convert.d.ts +65 -33
  65. package/dist/cli/traces-import-convert.js +211 -214
  66. package/dist/cli/traces-import-prepare.d.ts +26 -22
  67. package/dist/cli/traces-import-prepare.js +51 -122
  68. package/dist/cli/traces-import.d.ts +4 -4
  69. package/dist/cli/traces-import.js +63 -11
  70. package/dist/version.d.ts +1 -1
  71. package/dist/version.js +1 -1
  72. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ import type { ImportAdapter } from "./adapter.js";
2
+ /** The OpenTelemetry family of exports: binary OTLP and collector files, Jaeger, Zipkin and
3
+ * Arize Phoenix spans, kept as the OTLP spans they were; and Datadog LLM Observability spans,
4
+ * read as canonical rows. */
5
+ export declare const otelFamilyAdapters: readonly ImportAdapter[];
@@ -0,0 +1,17 @@
1
+ import { datadogLlmObs } from "./datadog.js";
2
+ import { jaeger, jaegerApiV3 } from "./jaeger.js";
3
+ import { otlpProtobuf } from "./otlp-protobuf.js";
4
+ import { phoenixOtlp, phoenixSpans } from "./phoenix.js";
5
+ import { zipkin } from "./zipkin.js";
6
+ /** The OpenTelemetry family of exports: binary OTLP and collector files, Jaeger, Zipkin and
7
+ * Arize Phoenix spans, kept as the OTLP spans they were; and Datadog LLM Observability spans,
8
+ * read as canonical rows. */
9
+ export const otelFamilyAdapters = [
10
+ otlpProtobuf,
11
+ jaegerApiV3,
12
+ jaeger,
13
+ zipkin,
14
+ phoenixOtlp,
15
+ phoenixSpans,
16
+ datadogLlmObs,
17
+ ];
@@ -0,0 +1,94 @@
1
+ import { type ConvertedTrace, type JsonValue, type OtlpAttribute, type Refusal } from "../traces-import-convert.js";
2
+ import type { TraceCollector } from "./adapter.js";
3
+ /**
4
+ * Spans of formats that record OpenTelemetry's span model in a shape of their own (Jaeger,
5
+ * Zipkin, Arize Phoenix): each is written as the OTLP span it was, with its attributes, kind,
6
+ * status, events, links, resource and scope kept under their own names. Unlike a row format's
7
+ * spans they get no GenAI attributes added, since the instrumentation that recorded them already
8
+ * wrote its conventions. Beside the recorded attributes each span carries its provenance:
9
+ * `hue.import.format`, the original ids where they changed, `hue.import.timing`,
10
+ * `hue.import.source_index` and the source record whole as `hue.import.source_record`.
11
+ *
12
+ * - Ids: a hex id of up to 32 (trace) or 16 (span) digits is the id it encodes, zero-padded on
13
+ * the left the way the OpenTelemetry Collector pads a 64-bit Jaeger or Zipkin trace id. Any
14
+ * other id is mapped by SHA-256 as row formats map theirs. The original is kept as
15
+ * `hue.import.original_trace_id` or `hue.import.original_span_id` whenever it changed.
16
+ * - A parent the export does not hold stays the span's parent, as in OTLP: Hue reads the span as
17
+ * a root of the trace.
18
+ * - Missing instants are filled by the row formats' documented rules (`rows.ts`), named in
19
+ * `hue.import.timing` and the report. A recorded end before its start refuses the trace.
20
+ * - Copies of a span with the same record are one span; copies that differ refuse the trace.
21
+ */
22
+ /** One span as a format read it, before ids are mapped and instants filled. */
23
+ export interface OtelSpan {
24
+ /** The trace id as the source recorded it. */
25
+ traceId: string;
26
+ /** The span's key within the trace: its id as recorded, or a key of the format's own for a
27
+ * span the source records twice under one id (see {@link OtelSpan.sourceSpanId}). */
28
+ spanKey: string;
29
+ /** The id the source recorded, when {@link OtelSpan.spanKey} is not it. */
30
+ sourceSpanId?: string;
31
+ /** The parent's key; a parent the export does not hold is kept as a parent outside it. */
32
+ parentKey?: string;
33
+ name: string;
34
+ /** OTLP `SpanKind`: 0 unspecified, 1 internal, 2 server, 3 client, 4 producer, 5 consumer. */
35
+ kind: number;
36
+ traceState?: string;
37
+ flags?: number;
38
+ /** Recorded instants in Unix nanoseconds; a missing one is filled by the documented rules. */
39
+ start?: bigint;
40
+ end?: bigint;
41
+ /** How the format took a recorded instant from another field; named in `hue.import.timing`. */
42
+ timing?: string;
43
+ attributes: OtlpAttribute[];
44
+ droppedAttributesCount?: number;
45
+ events: {
46
+ name: string;
47
+ time?: bigint;
48
+ attributes: OtlpAttribute[];
49
+ }[];
50
+ /** Links by the linked span's trace id as recorded and its key. */
51
+ links: {
52
+ traceId: string;
53
+ spanKey: string;
54
+ traceState?: string;
55
+ attributes: OtlpAttribute[];
56
+ }[];
57
+ status?: {
58
+ code: number;
59
+ message?: string;
60
+ };
61
+ resource: OtlpAttribute[];
62
+ /** The instrumentation scope the source names; `hue.import.<format>` when it names none. */
63
+ scope?: {
64
+ name: string;
65
+ version?: string;
66
+ };
67
+ /** The whole source record, kept as `hue.import.source_record`. */
68
+ record: JsonValue;
69
+ /** The record's position in its source. */
70
+ sequence?: number;
71
+ }
72
+ /** A hex id of at most `length` digits as the OpenTelemetry id it encodes, zero-padded on the
73
+ * left; undefined for anything else, and for an all-zero id. */
74
+ export declare function paddedId(value: string, length: 32 | 16): string | undefined;
75
+ /** The key a trace is gathered and named under (`context.refuse`, `readRecords`): its padded
76
+ * OpenTelemetry id when it is one, else the id as recorded, which `rowTraceId` maps by SHA-256. */
77
+ export declare const otelTraceKey: (traceId: string) => string;
78
+ /** Gathers one format's spans by trace across files and lines, and emits each trace as OTLP.
79
+ * `prepare` sees every distinct span of a trace before ids are mapped, for a format whose spans
80
+ * relate in ways only the whole trace shows (Zipkin's shared spans). */
81
+ export declare class OtelSpanCollector implements TraceCollector {
82
+ private readonly format;
83
+ private readonly prepare;
84
+ private readonly traces;
85
+ constructor(format: string, prepare?: (spans: OtelSpan[]) => OtelSpan[]);
86
+ add(span: OtelSpan, sourceDigest: string): void;
87
+ finish(): {
88
+ traces: ConvertedTrace[];
89
+ refused: Refusal[];
90
+ };
91
+ private emit;
92
+ }
93
+ /** A span id or count recorded as a nonnegative integer (a number or its decimal text). */
94
+ export declare function unsigned(value: unknown): bigint | undefined;
@@ -0,0 +1,262 @@
1
+ import { BlobSink, canonicalJson, ConversionError, conversionFailure, digestHex, MAX_INLINE_VALUE_BYTES, offloadOtlpValues, sha256Hex, SOURCE_RECORD, validateSource, } from "../traces-import-convert.js";
2
+ import { cyclic, rowTraceId, timesOf } from "./rows.js";
3
+ const HEX = /^[0-9a-f]+$/i;
4
+ const MAX_KEY = 4096;
5
+ /** The instrumentation scope version of a span with no scope of its own. */
6
+ const IMPORT_VERSION = "1";
7
+ /** Attributes that mark a trace as an evaluation's or a simulated world's, as Hue reads them. */
8
+ const EVALUATION_KEYS = ["hue.execution.id", "hue.eval.execution_id"];
9
+ const SIMULATION_KEYS = ["hue.world.id", "hue.environment.run_id"];
10
+ const SIMULATION_SCOPE = "hue.sim-gateway";
11
+ /** A hex id of at most `length` digits as the OpenTelemetry id it encodes, zero-padded on the
12
+ * left; undefined for anything else, and for an all-zero id. */
13
+ export function paddedId(value, length) {
14
+ if (!value || value.length > length || !HEX.test(value) || /^0+$/.test(value))
15
+ return undefined;
16
+ return value.toLowerCase().padStart(length, "0");
17
+ }
18
+ /** The key a trace is gathered and named under (`context.refuse`, `readRecords`): its padded
19
+ * OpenTelemetry id when it is one, else the id as recorded, which `rowTraceId` maps by SHA-256. */
20
+ export const otelTraceKey = (traceId) => paddedId(traceId, 32) ?? traceId;
21
+ const stringAttribute = (key, value) => ({
22
+ key,
23
+ value: { stringValue: value },
24
+ });
25
+ const stringOf = (value) => typeof value?.stringValue === "string" ? value.stringValue : undefined;
26
+ /** Gathers one format's spans by trace across files and lines, and emits each trace as OTLP.
27
+ * `prepare` sees every distinct span of a trace before ids are mapped, for a format whose spans
28
+ * relate in ways only the whole trace shows (Zipkin's shared spans). */
29
+ export class OtelSpanCollector {
30
+ format;
31
+ prepare;
32
+ traces = new Map();
33
+ constructor(format, prepare = (spans) => spans) {
34
+ this.format = format;
35
+ this.prepare = prepare;
36
+ }
37
+ add(span, sourceDigest) {
38
+ for (const [value, what] of [
39
+ [span.traceId, "trace id"],
40
+ [span.spanKey, "span id"],
41
+ ])
42
+ if (!value || value.length > MAX_KEY)
43
+ throw new ConversionError(`The record has no valid ${what}`);
44
+ validateSource(span.record);
45
+ const traceKey = otelTraceKey(span.traceId);
46
+ let draft = this.traces.get(traceKey);
47
+ if (!draft) {
48
+ draft = { spans: new Map(), sourceDigests: new Set() };
49
+ this.traces.set(traceKey, draft);
50
+ }
51
+ draft.sourceDigests.add(sourceDigest);
52
+ const copy = `${span.spanKey}\u0000${sha256Hex(`${canonicalJson(span.record)}\u0000${JSON.stringify(span.resource)}`)}`;
53
+ if (!draft.spans.has(copy))
54
+ draft.spans.set(copy, span);
55
+ }
56
+ finish() {
57
+ const traces = [];
58
+ const refused = [];
59
+ for (const [traceKey, draft] of this.traces) {
60
+ // Each draft is let go once its trace is emitted, so a run holds one copy of each record.
61
+ this.traces.delete(traceKey);
62
+ const traceId = rowTraceId(this.format, traceKey);
63
+ try {
64
+ traces.push(this.emit(traceKey, traceId, draft, refused));
65
+ }
66
+ catch (error) {
67
+ const failure = conversionFailure(error);
68
+ if (!failure)
69
+ throw error;
70
+ refused.push({ traceId, reason: failure.message });
71
+ }
72
+ }
73
+ return { traces, refused };
74
+ }
75
+ emit(traceKey, traceId, draft, refused) {
76
+ const format = this.format;
77
+ const byKey = new Map();
78
+ for (const span of this.prepare([...draft.spans.values()])) {
79
+ if (byKey.has(span.spanKey))
80
+ throw new ConversionError(`span ${span.spanKey} appears with different content`);
81
+ byKey.set(span.spanKey, span);
82
+ }
83
+ const keys = [...byKey.keys()].sort();
84
+ const mapSpan = (trace, key) => paddedId(key, 16) ?? digestHex(`${format}.span:${trace}:${key}`, 16);
85
+ // Span ids in key order, so a collision is salted the same way whatever order spans arrived.
86
+ const spanIds = new Map();
87
+ const taken = new Set();
88
+ for (const key of keys) {
89
+ let spanId = mapSpan(traceId, key);
90
+ for (let salt = 0; taken.has(spanId); salt++)
91
+ spanId = digestHex(`${format}.span:${traceId}:${key}#${salt}`, 16);
92
+ taken.add(spanId);
93
+ spanIds.set(key, spanId);
94
+ }
95
+ const rows = new Map(keys.map((key) => {
96
+ const span = byKey.get(key);
97
+ return [
98
+ key,
99
+ {
100
+ traceKey,
101
+ spanKey: key,
102
+ name: span.name,
103
+ record: null,
104
+ ...(span.parentKey !== undefined ? { parentKey: span.parentKey } : {}),
105
+ ...(span.start !== undefined ? { start: span.start } : {}),
106
+ ...(span.end !== undefined ? { end: span.end } : {}),
107
+ ...(span.sequence !== undefined ? { sequence: span.sequence } : {}),
108
+ },
109
+ ];
110
+ }));
111
+ const parentOf = (row) => row.parentKey !== undefined && row.parentKey !== row.spanKey && rows.has(row.parentKey)
112
+ ? row.parentKey
113
+ : undefined;
114
+ if (cyclic(rows, parentOf))
115
+ throw new ConversionError("The source hierarchy contains a cycle");
116
+ const { starts, ends, notes } = timesOf(rows, parentOf);
117
+ const traceNotes = new Set([...notes.values()].flat());
118
+ const blobs = new BlobSink();
119
+ let evaluation = false;
120
+ let simulation = false;
121
+ let production = false;
122
+ let remappedSpans = 0;
123
+ const ordered = [...keys].sort((a, b) => {
124
+ const [x, y] = [starts.get(a), starts.get(b)];
125
+ return x < y ? -1 : x > y ? 1 : spanIds.get(a) < spanIds.get(b) ? -1 : 1;
126
+ });
127
+ const entries = ordered.map((key) => {
128
+ const span = byKey.get(key);
129
+ const spanId = spanIds.get(key);
130
+ if (span.attributes.some((attribute) => attribute.key.startsWith("hue.import.")))
131
+ throw new ConversionError("Source attributes use reserved import keys");
132
+ const attributes = [...span.attributes];
133
+ attributes.push(stringAttribute("hue.import.format", format));
134
+ if (span.traceId !== traceId)
135
+ attributes.push(stringAttribute("hue.import.original_trace_id", span.traceId));
136
+ const original = span.sourceSpanId ?? key;
137
+ if (spanId !== original) {
138
+ attributes.push(stringAttribute("hue.import.original_span_id", original));
139
+ remappedSpans++;
140
+ }
141
+ let parentSpanId;
142
+ if (span.parentKey !== undefined && span.parentKey !== key) {
143
+ const held = spanIds.get(span.parentKey);
144
+ parentSpanId = held ?? mapSpan(traceId, span.parentKey);
145
+ const recorded = byKey.get(span.parentKey)?.sourceSpanId ?? span.parentKey;
146
+ if (held === undefined && parentSpanId !== recorded)
147
+ attributes.push(stringAttribute("hue.import.original_parent_span_id", recorded));
148
+ }
149
+ if (span.sequence !== undefined)
150
+ attributes.push({
151
+ key: "hue.import.source_index",
152
+ value: { intValue: String(span.sequence) },
153
+ });
154
+ const spanNotes = [...(span.timing ? [span.timing] : []), ...(notes.get(key) ?? [])];
155
+ if (span.timing)
156
+ traceNotes.add(span.timing);
157
+ if (spanNotes.length)
158
+ attributes.push(stringAttribute("hue.import.timing", spanNotes.join("; ")));
159
+ attributes.push(stringAttribute(SOURCE_RECORD, JSON.stringify(span.record)));
160
+ const start = starts.get(key);
161
+ // An event too large to keep inline is left out and reported, as row formats do; the
162
+ // source record, stored apart when it is large, still holds it.
163
+ const events = span.events.flatMap((event) => {
164
+ if (Buffer.byteLength(JSON.stringify(event.attributes)) > MAX_INLINE_VALUE_BYTES) {
165
+ refused.push({ reason: `an event of span ${key} is over the inline value limit` });
166
+ return [];
167
+ }
168
+ if (event.time === undefined)
169
+ traceNotes.add("event_at_span_start");
170
+ return [
171
+ {
172
+ timeUnixNano: (event.time ?? start).toString(),
173
+ name: event.name,
174
+ attributes: event.attributes,
175
+ },
176
+ ];
177
+ });
178
+ const links = span.links.map((link) => {
179
+ const linkKey = otelTraceKey(link.traceId);
180
+ const linkTrace = linkKey === traceKey ? traceId : rowTraceId(format, linkKey);
181
+ const linkSpan = linkKey === traceKey
182
+ ? (spanIds.get(link.spanKey) ?? mapSpan(traceId, link.spanKey))
183
+ : mapSpan(linkTrace, link.spanKey);
184
+ return {
185
+ traceId: linkTrace,
186
+ spanId: linkSpan,
187
+ ...(link.traceState ? { traceState: link.traceState } : {}),
188
+ attributes: link.attributes,
189
+ };
190
+ });
191
+ const scope = span.scope?.name
192
+ ? span.scope
193
+ : { name: `hue.import.${format}`, version: IMPORT_VERSION };
194
+ const has = (key) => span.attributes.some((attribute) => attribute.key === key) ||
195
+ span.resource.some((attribute) => attribute.key === key);
196
+ if (EVALUATION_KEYS.some(has))
197
+ evaluation = true;
198
+ if (SIMULATION_KEYS.some(has) || scope.name === SIMULATION_SCOPE)
199
+ simulation = true;
200
+ for (const attribute of span.resource)
201
+ if ((attribute.key === "deployment.environment.name" ||
202
+ attribute.key === "deployment.environment") &&
203
+ stringOf(attribute.value) === "production")
204
+ production = true;
205
+ return {
206
+ resource: { attributes: span.resource },
207
+ scopeSpans: [
208
+ {
209
+ scope,
210
+ spans: [
211
+ {
212
+ traceId,
213
+ spanId,
214
+ ...(parentSpanId !== undefined ? { parentSpanId } : {}),
215
+ ...(span.traceState ? { traceState: span.traceState } : {}),
216
+ ...(span.flags !== undefined ? { flags: span.flags } : {}),
217
+ name: span.name,
218
+ kind: span.kind,
219
+ startTimeUnixNano: start.toString(),
220
+ endTimeUnixNano: ends.get(key).toString(),
221
+ attributes: offloadOtlpValues(attributes, blobs),
222
+ ...(span.droppedAttributesCount
223
+ ? { droppedAttributesCount: span.droppedAttributesCount }
224
+ : {}),
225
+ ...(events.length ? { events } : {}),
226
+ ...(links.length ? { links } : {}),
227
+ status: span.status ?? { code: 0 },
228
+ },
229
+ ],
230
+ },
231
+ ],
232
+ };
233
+ });
234
+ const origin = evaluation
235
+ ? "evaluation"
236
+ : simulation
237
+ ? "simulation"
238
+ : production
239
+ ? "production"
240
+ : "unknown";
241
+ const inferredTiming = [...traceNotes].sort();
242
+ return {
243
+ traceId,
244
+ format,
245
+ entries,
246
+ blobs: blobs.sorted(),
247
+ origin,
248
+ sourceDigests: draft.sourceDigests,
249
+ remappedTraceId: [...byKey.values()].some((span) => span.traceId !== traceId),
250
+ remappedSpans,
251
+ ...(inferredTiming.length ? { inferredTiming } : {}),
252
+ };
253
+ }
254
+ }
255
+ /** A span id or count recorded as a nonnegative integer (a number or its decimal text). */
256
+ export function unsigned(value) {
257
+ if (typeof value === "number" && Number.isSafeInteger(value) && value >= 0)
258
+ return BigInt(value);
259
+ if (typeof value === "string" && /^\d{1,20}$/.test(value))
260
+ return BigInt(value);
261
+ return undefined;
262
+ }
@@ -0,0 +1,35 @@
1
+ import type { ImportAdapter } from "./adapter.js";
2
+ import type { ParsedValue } from "./containers.js";
3
+ /** A decoded request and the spans of it that could not be read, by the trace they name. */
4
+ interface DecodedTraces {
5
+ request: Record<string, unknown>;
6
+ refused: {
7
+ traceId?: string;
8
+ reason: string;
9
+ }[];
10
+ }
11
+ /** A `TracesData` or `ExportTraceServiceRequest` (the same fields) as OTLP/JSON, with the spans
12
+ * that could not be read. */
13
+ export declare function decodeTraces(bytes: Uint8Array): DecodedTraces;
14
+ /** The values of a binary OTLP file, read one at a time; the messages that could not be read are
15
+ * added to `problems` as they are met, and `bytes` grows to the file's decompressed size. */
16
+ export interface BinaryValues {
17
+ values: Iterable<ParsedValue>;
18
+ problems: {
19
+ line: number;
20
+ reason: string;
21
+ }[];
22
+ bytes: () => number;
23
+ }
24
+ /**
25
+ * The values of a binary OTLP file; undefined when the content is not binary or holds neither
26
+ * form, so that it is read as text; or why a binary OTLP request cannot be read. In a
27
+ * length-prefixed file each message is one value, its 1-based position given as its line; a
28
+ * message that cannot be read is reported with that position and the rest are read, until the
29
+ * messages together decompress to more than `maxBytes`.
30
+ */
31
+ export declare function binaryValues(bytes: Uint8Array, maxBytes: number): BinaryValues | {
32
+ unsupported: string;
33
+ } | undefined;
34
+ export declare const otlpProtobuf: ImportAdapter;
35
+ export {};