autotel-devtools 22.0.0 → 23.0.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 (46) hide show
  1. package/README.md +183 -28
  2. package/dist/cli.cjs +80 -13
  3. package/dist/cli.js +80 -13
  4. package/dist/compile-JDFHUCo5.d.cts +177 -0
  5. package/dist/compile-JDFHUCo5.d.ts +177 -0
  6. package/dist/{error-aggregator-D8VKciLY.d.ts → error-aggregator-B52JI8jL.d.ts} +1 -1
  7. package/dist/{error-aggregator-DCEKMOm3.d.cts → error-aggregator-DSwUvgFF.d.cts} +1 -1
  8. package/dist/exporter-BrEcnzoT.d.ts +546 -0
  9. package/dist/exporter-C4uKgo7l.d.cts +546 -0
  10. package/dist/fullpage.global.js +39 -0
  11. package/dist/grpc-CSWjMRiB.cjs +82 -0
  12. package/dist/grpc-CZEDUYCM.js +77 -0
  13. package/dist/http-Cqm_MAtc.cjs +3942 -0
  14. package/dist/http-Dbd9TIYU.js +3776 -0
  15. package/dist/index.cjs +25 -7
  16. package/dist/index.d.cts +30 -3
  17. package/dist/index.d.ts +30 -3
  18. package/dist/index.js +25 -7
  19. package/dist/{listen-DBfsfcdd.js → listen-D-lLgfro.js} +5 -2
  20. package/dist/{listen-CEJ3nYJf.cjs → listen-l09RRHht.cjs} +5 -2
  21. package/dist/parse-BRlosZft.cjs +642 -0
  22. package/dist/parse-D_RmPPQs.js +612 -0
  23. package/dist/query/index.cjs +8 -0
  24. package/dist/query/index.d.cts +16 -0
  25. package/dist/query/index.d.ts +16 -0
  26. package/dist/query/index.js +3 -0
  27. package/dist/server/exporter.d.cts +1 -1
  28. package/dist/server/exporter.d.ts +1 -1
  29. package/dist/server/index.cjs +6 -2
  30. package/dist/server/index.d.cts +19 -6
  31. package/dist/server/index.d.ts +18 -5
  32. package/dist/server/index.js +3 -2
  33. package/dist/types-B0tjwFqj.d.cts +107 -0
  34. package/dist/types-DM8y4A9Z.d.ts +107 -0
  35. package/dist/widget.global.js +15 -24
  36. package/dist/wire/index.cjs +7 -0
  37. package/dist/wire/index.d.cts +26 -0
  38. package/dist/wire/index.d.ts +26 -0
  39. package/dist/wire/index.js +3 -0
  40. package/dist/wire-2Rmfg6IT.js +51 -0
  41. package/dist/wire-CHU1PkMo.cjs +75 -0
  42. package/package.json +21 -5
  43. package/dist/exporter-Dt4kx128.d.cts +0 -207
  44. package/dist/exporter-Due9Rd4s.d.ts +0 -207
  45. package/dist/http-CNZMrnzv.js +0 -1453
  46. package/dist/http-CXSzX4ee.cjs +0 -1607
@@ -0,0 +1,546 @@
1
+ import { c as QueryError, r as SignalSchema } from "./compile-JDFHUCo5.js";
2
+ import { n as SpanAttributes } from "./types-DHDvZnnn.js";
3
+ import { i as LogData, n as ErrorGroup, o as TraceData, t as DevtoolsData } from "./types-DM8y4A9Z.js";
4
+ import { Server } from "node:http";
5
+ import { AgentRawEvent, OtelMetricRecord } from "autotel-agents";
6
+ import { ExportResult } from "@opentelemetry/core";
7
+ import { ReadableSpan, SpanExporter } from "@opentelemetry/sdk-trace-base";
8
+ //#region src/server/metric-streams.d.ts
9
+ type MetricKind = 'gauge' | 'sum' | 'histogram' | 'exponentialHistogram' | 'summary';
10
+ type MetricTemporality = 'delta' | 'cumulative';
11
+ /** A data point's link back to the trace that produced it. */
12
+ interface MetricExemplar {
13
+ value: number;
14
+ timestamp: number;
15
+ traceId?: string;
16
+ spanId?: string;
17
+ }
18
+ interface ExponentialBuckets {
19
+ offset: number;
20
+ bucketCounts: number[];
21
+ }
22
+ interface MetricPoint {
23
+ timestamp: number;
24
+ startTimestamp?: number;
25
+ attributes: SpanAttributes;
26
+ /** Gauge and sum. */
27
+ value?: number;
28
+ /** Histogram and summary. */
29
+ count?: number;
30
+ sum?: number;
31
+ min?: number;
32
+ max?: number;
33
+ /** Histogram: one longer than `explicitBounds` — the last is +Inf. */
34
+ bucketCounts?: number[];
35
+ explicitBounds?: number[];
36
+ /** Exponential histogram fields, preserved without lossy rebucketing. */
37
+ scale?: number;
38
+ zeroCount?: number;
39
+ zeroThreshold?: number;
40
+ positive?: ExponentialBuckets;
41
+ negative?: ExponentialBuckets;
42
+ /** Summary: precomputed quantiles. */
43
+ quantiles?: Array<{
44
+ quantile: number;
45
+ value: number;
46
+ }>;
47
+ exemplars?: MetricExemplar[];
48
+ }
49
+ interface MetricStreamRecord {
50
+ name: string;
51
+ unit?: string;
52
+ description?: string;
53
+ kind: MetricKind;
54
+ temporality?: MetricTemporality;
55
+ /** Sums only. A non-monotonic sum is an up/down counter, not a rate. */
56
+ monotonic?: boolean;
57
+ service: string;
58
+ scope?: {
59
+ name: string;
60
+ version?: string;
61
+ };
62
+ resource: SpanAttributes;
63
+ points: MetricPoint[];
64
+ }
65
+ //#endregion
66
+ //#region src/server/store/store.d.ts
67
+ interface TimeWindow {
68
+ /** Epoch ms, inclusive. */
69
+ start: number;
70
+ /** Epoch ms, inclusive. */
71
+ end: number;
72
+ }
73
+ interface DevtoolsStoreOptions {
74
+ /** File path. Omit for an in-memory database (nothing persists). */
75
+ path?: string;
76
+ /** Maximum traces retained; the oldest are pruned past this. */
77
+ maxTraces?: number;
78
+ /**
79
+ * Maximum metric points retained **per series**, not in total.
80
+ *
81
+ * Per-series is the point: a global cap lets one chatty instrument evict
82
+ * every other series, so the quiet metric you were actually watching goes
83
+ * blank while a noisy one fills the buffer.
84
+ */
85
+ maxMetricPoints?: number;
86
+ /** Maximum logs retained; the oldest are pruned past this. */
87
+ maxLogs?: number;
88
+ /** Logical sqlite size cap. Defaults to 512 MiB in memory or 2 GiB on disk. */
89
+ maxBytes?: number;
90
+ }
91
+ interface StoreStats {
92
+ bytesUsed: number;
93
+ maxBytes: number;
94
+ traceCount: number;
95
+ spanCount: number;
96
+ logCount: number;
97
+ metricSeriesCount: number;
98
+ metricPointCount: number;
99
+ }
100
+ interface TraceProjection {
101
+ traceId: string;
102
+ serviceName: string;
103
+ durationMs: number;
104
+ statusCode: 'OK' | 'ERROR' | 'UNSET';
105
+ spanCount: number;
106
+ errorSpanCount: number;
107
+ serviceCount: number;
108
+ llmSpanCount: number;
109
+ totalTokens: number;
110
+ modelsUsed: string[];
111
+ topOperations: Array<{
112
+ operation: string;
113
+ count: number;
114
+ }>;
115
+ slowestSpans: Array<{
116
+ spanId: string;
117
+ name: string;
118
+ service: string;
119
+ durationMs: number;
120
+ /** Selects this span, not just the trace containing it. */
121
+ deepLink: string;
122
+ }>;
123
+ deepLink: string;
124
+ }
125
+ interface QueryTracesArgs {
126
+ query: string;
127
+ window?: TimeWindow;
128
+ limit?: number;
129
+ /** Opaque keyset cursor from a previous page's `nextCursor`. */
130
+ cursor?: string;
131
+ }
132
+ interface QueryTracesResult {
133
+ traces: TraceData[];
134
+ /** Cursor for the next page, or null when this is the last one. */
135
+ nextCursor: string | null;
136
+ /** Present only when the query text failed to parse. */
137
+ errors?: QueryError[];
138
+ }
139
+ /** One chart line, with the points to draw it. */
140
+ interface MetricSeries {
141
+ seriesId: string;
142
+ name: string;
143
+ unit?: string;
144
+ description?: string;
145
+ kind: MetricKind;
146
+ temporality?: MetricTemporality;
147
+ monotonic?: boolean;
148
+ service: string;
149
+ scope?: {
150
+ name: string;
151
+ version?: string;
152
+ };
153
+ /** Full resource identity (host, pod, process, deployment, and service). */
154
+ resource: SpanAttributes;
155
+ /** The attributes that distinguish this series from its siblings. */
156
+ attributes: SpanAttributes;
157
+ points: MetricPoint[];
158
+ }
159
+ /** A row in the metric catalogue. */
160
+ interface MetricCatalogEntry {
161
+ name: string;
162
+ kind: MetricKind;
163
+ unit?: string;
164
+ description?: string;
165
+ seriesCount: number;
166
+ }
167
+ interface QueryMetricSeriesArgs {
168
+ name: string;
169
+ window?: TimeWindow;
170
+ /** Maximum points returned per series after server-side reduction. */
171
+ maxPoints?: number;
172
+ }
173
+ interface QueryLogsArgs {
174
+ query: string;
175
+ window?: TimeWindow;
176
+ limit?: number;
177
+ cursor?: string;
178
+ }
179
+ interface QueryLogsResult {
180
+ logs: LogData[];
181
+ nextCursor: string | null;
182
+ errors?: QueryError[];
183
+ }
184
+ declare const SPAN_SCHEMA: SignalSchema;
185
+ declare class DevtoolsStore {
186
+ private readonly db;
187
+ private readonly maxTraces;
188
+ private readonly maxMetricPoints;
189
+ private readonly maxLogs;
190
+ private readonly maxBytes;
191
+ constructor(options?: DevtoolsStoreOptions);
192
+ /** Refuse a file this build cannot read, before any query touches it. */
193
+ private guardSchemaVersion;
194
+ /** Upgrade databases created before span identity included the trace id. */
195
+ private migrateSpanIdentity;
196
+ /** Add lossless metric fields to databases created by earlier releases. */
197
+ private migrateMetricFidelity;
198
+ private hasColumn;
199
+ private addColumnIfMissing;
200
+ private migrateLegacyMetricSeriesIdentity;
201
+ /**
202
+ * SQLite parses `REGEXP` but ships no implementation — using it without
203
+ * registering one is a runtime error, not a syntax error. The language offers
204
+ * regex matching, so the function has to exist.
205
+ *
206
+ * An invalid pattern matches nothing rather than throwing: the user is
207
+ * probably mid-typing, and a thrown error would blank the whole result list.
208
+ */
209
+ private registerRegexp;
210
+ ingestTraces(traces: TraceData[]): void;
211
+ /**
212
+ * Find traces matching a query.
213
+ *
214
+ * The filter runs against *spans* and the results are traces: a trace matches
215
+ * when any of its spans does. That is what makes `http.status_code = 500`
216
+ * useful — the attribute is on one span, but the thing you want to open is
217
+ * the trace containing it.
218
+ */
219
+ queryTraces(args: QueryTracesArgs): QueryTracesResult;
220
+ ingestLogs(logs: LogData[]): void;
221
+ queryLogs(args: QueryLogsArgs): QueryLogsResult;
222
+ countLogs(): number;
223
+ /**
224
+ * Store metric points, grouped into series.
225
+ *
226
+ * One series is one chart line: `(name, kind, unit, service, scope, point
227
+ * attributes)`. Both directions of getting this wrong are bad — too coarse
228
+ * and every line collapses into one meaningless average, too fine and one
229
+ * logical series sprouts a new line on every export — so the identity is a
230
+ * content hash over exactly those fields, with attribute keys sorted so an
231
+ * exporter's key ordering cannot split a series in two.
232
+ */
233
+ ingestMetrics(streams: MetricStreamRecord[]): void;
234
+ /** Every metric name held, for the catalogue the Metrics tab lists. */
235
+ listMetricNames(): MetricCatalogEntry[];
236
+ queryMetricCatalog(query: string): {
237
+ metrics: MetricCatalogEntry[];
238
+ errors?: QueryError[];
239
+ };
240
+ /**
241
+ * The series for one metric, with their points.
242
+ *
243
+ * A series whose points all fall outside the window is omitted rather than
244
+ * returned empty: an empty line in the legend claims data exists where none
245
+ * does, and the caller cannot tell the two apart.
246
+ */
247
+ queryMetricSeries(args: QueryMetricSeriesArgs): MetricSeries[];
248
+ getTrace(traceId: string): TraceData | null;
249
+ describeTrace(traceId: string): TraceProjection | null;
250
+ findSlowest(limit?: number): TraceProjection[];
251
+ countSpans(): number;
252
+ countTraces(): number;
253
+ /**
254
+ * One row per matching span, for a cohort comparison.
255
+ *
256
+ * Attributes plus the first-class columns, because "the slow ones are all
257
+ * `service=payments`" is exactly the shape of answer wanted and `service` is
258
+ * a column rather than an attribute. Ids are left out: they take a distinct
259
+ * value per span, so they can never describe a group, and including them
260
+ * only gives the ranking noise to wade through.
261
+ *
262
+ * Throws on a query that does not parse. Returning an empty cohort instead
263
+ * would surface as "no difference found", which is a different and much
264
+ * more misleading answer than "your query is wrong".
265
+ */
266
+ cohortRows(args: QueryTracesArgs): Array<Record<string, unknown>>;
267
+ /**
268
+ * What the store has actually seen, for the coverage join.
269
+ *
270
+ * Both routes in are counted: the `http.route` attribute a framework
271
+ * integration sets, and the span name, which is what `trace('name', fn)`
272
+ * produces and is all a non-HTTP entry point ever has. Counting is cheap
273
+ * here because `attribute_values` already carries per-value totals.
274
+ */
275
+ observedSpans(): {
276
+ routeCounts: Record<string, number>;
277
+ spanNameCounts: Record<string, number>;
278
+ };
279
+ /** Query fields currently present, for editor completion. */
280
+ listQueryFields(signal: 'traces' | 'logs', limit?: number): string[];
281
+ searchAttributes(signal: 'traces' | 'logs', value: string, limit?: number): Array<{
282
+ key: string;
283
+ value: unknown;
284
+ count: number;
285
+ }>;
286
+ private attributeUpsert;
287
+ private attributeOccurrenceUpsert;
288
+ private indexAttributes;
289
+ /**
290
+ * Index the events and links already sitting in the span JSON.
291
+ *
292
+ * A `--db` file written before these tables existed holds spans whose events
293
+ * no query can reach. Reading them out of the JSON on open is what makes
294
+ * `event.name = …` work against telemetry captured yesterday. Keyed on the
295
+ * table being empty while spans exist, so it runs once rather than on every
296
+ * open.
297
+ */
298
+ private backfillSpanChildren;
299
+ private backfillAttributeDictionary;
300
+ /**
301
+ * Prune the oldest traces past the row cap, and their spans with them.
302
+ *
303
+ * Spans are deleted in the same transaction as their traces: a pruned trace
304
+ * that left its spans behind would leave rows that no query can reach and no
305
+ * later sweep would find, since every sweep starts from `traces`.
306
+ */
307
+ enforceRetention(): void;
308
+ getStats(): StoreStats;
309
+ private enforceByteRetention;
310
+ /**
311
+ * Trim each series to its newest `maxMetricPoints`.
312
+ *
313
+ * Per series, not globally: a global cap would let one chatty instrument
314
+ * evict every other series, blanking the quiet chart someone was watching.
315
+ */
316
+ private enforceMetricRetention;
317
+ /** Trim the log table to its newest `maxLogs` rows. */
318
+ private enforceLogRetention;
319
+ private removeOrphanedAttributes;
320
+ clear(): void;
321
+ clearSignal(signal: 'traces' | 'logs' | 'metrics'): void;
322
+ deleteMetric(name: string): number;
323
+ deleteTraces(traceIds: string[]): number;
324
+ close(): void;
325
+ /**
326
+ * Hydrate a page of traces with one span query rather than one per trace.
327
+ *
328
+ * A list of 100 traces was 101 statements: the page, then a `SELECT` per
329
+ * trace. Grouping in memory costs the same rows and one round of planning.
330
+ * Ordering is `trace_id, start_time` so each group arrives already in the
331
+ * order a waterfall draws it, which is what the list-hydration test pins.
332
+ */
333
+ private hydrateTracePage;
334
+ private hydrateTrace;
335
+ /** The row-to-trace mapping, shared by the single and batched paths. */
336
+ private assembleTrace;
337
+ }
338
+ //#endregion
339
+ //#region src/server/server.d.ts
340
+ interface DevtoolsServerOptions {
341
+ port?: number;
342
+ server?: Server;
343
+ path?: string;
344
+ verbose?: boolean;
345
+ maxHistory?: number;
346
+ maxTraceCount?: number;
347
+ maxLogCount?: number;
348
+ maxMetricCount?: number;
349
+ /**
350
+ * Bind host, used only to decide the WebSocket origin policy. A loopback host
351
+ * (the default) enables the DNS-rebinding `Host` check on the live stream; an
352
+ * explicit non-loopback bind opts out, leaving just the cross-origin check.
353
+ */
354
+ host?: string;
355
+ /**
356
+ * Called after each ingest, with the incremental data just broadcast to WS
357
+ * clients. Lets an embedder (e.g. the VS Code extension) react to new
358
+ * telemetry — refresh its own tree views — while the server owns the buffer.
359
+ */
360
+ onData?: (incremental: DevtoolsData) => void;
361
+ /**
362
+ * Path to the sqlite database backing the store. Omit for in-memory, which
363
+ * is the default so existing embedders keep their previous behaviour: they
364
+ * get querying and paging, but nothing is written to disk unless asked for.
365
+ */
366
+ dbPath?: string;
367
+ /** Maximum traces retained in the store before the oldest are pruned. */
368
+ maxTraces?: number;
369
+ /** Maximum logs retained in the store before the oldest are pruned. */
370
+ maxLogs?: number;
371
+ /** Maximum logical sqlite size before oldest telemetry is pruned. */
372
+ maxDbBytes?: number;
373
+ /**
374
+ * How often to prune the store past its caps, in ms. `0` disables the loop.
375
+ *
376
+ * Retention has to run on a timer, not only on ingest: a session that stops
377
+ * receiving telemetry should not keep whatever it accumulated forever, and
378
+ * pruning inside the ingest path would put a delete on the hot path of every
379
+ * batch.
380
+ */
381
+ retentionIntervalMs?: number;
382
+ }
383
+ /**
384
+ * Traces read when aggregating errors.
385
+ *
386
+ * Deliberately large: an error group's count is only right if every occurrence
387
+ * in the window is seen, and a page-sized read would under-report the common
388
+ * failures most — the ones with occurrences past the page boundary.
389
+ */
390
+ declare class DevtoolsServer {
391
+ private wss;
392
+ private readonly wsPath;
393
+ private readonly loopbackOnly;
394
+ private clients;
395
+ private httpServer;
396
+ private traces;
397
+ private logs;
398
+ private agentSessions;
399
+ private errorAggregator;
400
+ private limits;
401
+ private verbose;
402
+ private _port;
403
+ private onData?;
404
+ /**
405
+ * Durable store. The in-memory `traces`/`logs` arrays above remain the live
406
+ * tail — what a freshly-connected client is handed and what streams over WS —
407
+ * while the store answers queries and outlives the process. Both are written
408
+ * on every ingest; neither is derived from the other.
409
+ */
410
+ private store;
411
+ private retentionTimer;
412
+ constructor(options?: DevtoolsServerOptions);
413
+ get port(): number;
414
+ get clientCount(): number;
415
+ addTrace(trace: TraceData): void;
416
+ addTraces(traces: TraceData[]): void;
417
+ addLog(log: LogData): void;
418
+ addLogs(logs: LogData[]): void;
419
+ /** Ingest one decoded OTLP request, regardless of its transport. */
420
+ /**
421
+ * Serve the live tail on another HTTP listener.
422
+ *
423
+ * A loopback bind produces two listeners, one per IP family, because
424
+ * `localhost` resolves to `::1` on macOS and `127.0.0.1` elsewhere. The HTTP
425
+ * routes were attached to both from the start and the WebSocket was not, so
426
+ * the widget connected over one address and silently failed over the other:
427
+ * telemetry visible, live tail dead, and nothing in the UI saying why.
428
+ *
429
+ * Both listeners hand their upgrades to the same `WebSocketServer`, so there
430
+ * is still one client set and one broadcast.
431
+ */
432
+ attachWebSocket(server: Server): void;
433
+ ingestOtlp(signal: 'traces' | 'logs' | 'metrics', payload: unknown): number;
434
+ /** Fold decoded agent log events into sessions and broadcast the full set. */
435
+ ingestAgentEvents(records: AgentRawEvent[]): void;
436
+ /**
437
+ * Store decoded metric streams for the Metrics tab.
438
+ *
439
+ * Separate from `ingestAgentMetrics`: that folds the same OTLP batch into
440
+ * coding-agent sessions through a counter-shaped model, while this keeps the
441
+ * full data points — buckets, quantiles, exemplars — that charts need.
442
+ */
443
+ ingestMetricStreams(streams: MetricStreamRecord[]): void;
444
+ /** Metric catalogue: every metric name held, with its kind and series count. */
445
+ listMetricNames(): MetricCatalogEntry[];
446
+ queryMetricCatalog(query: string): {
447
+ metrics: MetricCatalogEntry[];
448
+ errors?: QueryError[];
449
+ };
450
+ /** The series for one metric, with their points. */
451
+ queryMetricSeries(args: QueryMetricSeriesArgs): MetricSeries[];
452
+ /** Fold decoded agent metric records into sessions and broadcast the full set. */
453
+ ingestAgentMetrics(records: OtelMetricRecord[]): void;
454
+ private broadcastAgents;
455
+ /**
456
+ * Run a query against the durable store.
457
+ *
458
+ * Distinct from `getCurrentData()`, which returns the live tail: this reaches
459
+ * the whole retained history, which is normally far larger than the tail and
460
+ * is the only way to see anything from before the process restarted.
461
+ */
462
+ queryTraces(args: QueryTracesArgs): QueryTracesResult;
463
+ /** Route and span-name counts, for the instrumentation coverage join. */
464
+ observedSpans(): ReturnType<DevtoolsStore['observedSpans']>;
465
+ /** One row per matching span, as the population for a cohort comparison. */
466
+ cohortRows(args: QueryTracesArgs): Array<Record<string, unknown>>;
467
+ /**
468
+ * Aggregate errors from the store for a window and query.
469
+ *
470
+ * A fresh aggregator over whatever the store returns, rather than a second
471
+ * implementation: the grouping, fingerprinting and sampling rules are the
472
+ * same ones the live path uses, so the two cannot describe the same failure
473
+ * differently.
474
+ *
475
+ * The live `errorAggregator` stays as it is — it backs the WS full-state
476
+ * broadcast, which has no window and needs none.
477
+ */
478
+ queryErrors(args: QueryTracesArgs): {
479
+ errors: ErrorGroup[];
480
+ errors_parse?: QueryError[];
481
+ };
482
+ /** Run a log query against the durable store. */
483
+ queryLogs(args: QueryLogsArgs): QueryLogsResult;
484
+ listQueryFields(signal: 'traces' | 'logs'): string[];
485
+ searchAttributes(signal: 'traces' | 'logs', value: string, limit?: number): {
486
+ key: string;
487
+ value: unknown;
488
+ count: number;
489
+ }[];
490
+ getStoreStats(): StoreStats;
491
+ describeTrace(traceId: string): TraceProjection | null;
492
+ findSlowestTraces(limit?: number): TraceProjection[];
493
+ /** Prune the store to its retention cap. Safe to call on a timer. */
494
+ enforceRetention(): void;
495
+ /**
496
+ * Prune periodically for the life of the server.
497
+ *
498
+ * `unref` matters: without it this timer alone keeps the Node process alive,
499
+ * so a CLI that has finished its work would hang instead of exiting. A
500
+ * failure is logged rather than thrown — an interval callback that throws
501
+ * takes the process down, and a missed prune is not worth that.
502
+ */
503
+ private startRetentionLoop;
504
+ getCurrentData(): DevtoolsData;
505
+ clearData(): void;
506
+ clearSignal(signal: 'traces' | 'logs' | 'metrics'): void;
507
+ deleteMetric(name: string): number;
508
+ deleteTraces(traceIds: string[]): number;
509
+ private broadcast;
510
+ private log;
511
+ close(): Promise<void>;
512
+ }
513
+ //#endregion
514
+ //#region src/server/exporter.d.ts
515
+ declare class DevtoolsSpanExporter implements SpanExporter {
516
+ private server;
517
+ private serviceName;
518
+ constructor(server: DevtoolsServer, serviceName?: string);
519
+ /**
520
+ * Export spans to the WebSocket server
521
+ */
522
+ export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): Promise<void>;
523
+ /**
524
+ * Shutdown the exporter
525
+ */
526
+ shutdown(): Promise<void>;
527
+ /**
528
+ * Force flush any buffered spans
529
+ */
530
+ forceFlush(): Promise<void>;
531
+ /**
532
+ * Convert OpenTelemetry spans to TraceData
533
+ */
534
+ private convertToTraceData;
535
+ /**
536
+ * Convert OpenTelemetry span to SpanData
537
+ */
538
+ private convertSpan;
539
+ private convertScope;
540
+ /**
541
+ * Convert OpenTelemetry SpanKind to string
542
+ */
543
+ private convertSpanKind;
544
+ }
545
+ //#endregion
546
+ export { DevtoolsStoreOptions as a, QueryLogsArgs as c, QueryTracesArgs as d, QueryTracesResult as f, DevtoolsStore as i, QueryLogsResult as l, TimeWindow as m, DevtoolsServer as n, MetricCatalogEntry as o, SPAN_SCHEMA as p, DevtoolsServerOptions as r, MetricSeries as s, DevtoolsSpanExporter as t, QueryMetricSeriesArgs as u };