src/vs/platform/otel/common/spanData.ts
44 LOC · 44 covered · 0 uncovered · 1 ranges · 56 concepts · 1 introducers · 29 tests
File neighbourhood
The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.
Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.
/*---------------------------------------------------------------------------------------------
spanData.ts ×1
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Minimal, SDK-agnostic types for completed OTel spans.
*
* These mirror the shape used by the Copilot extension (kept in sync with
* `extensions/copilot/src/platform/otel/common/otelService.ts`) so the same
* bridge processor can be ported to the Agent Host without dragging in the
* extension's full `IOTelService` surface.
*/
export const enum SpanStatusCode {
UNSET = 0,
OK = 1,
ERROR = 2,
}
/**
* Serializable snapshot of a completed span.
* Contains all in-memory attributes (including content attributes regardless of captureContent).
*/
export interface ICompletedSpanData {
readonly name: string;
readonly spanId: string;
readonly traceId: string;
readonly parentSpanId?: string;
readonly startTime: number; // milliseconds since epoch
readonly endTime: number; // milliseconds since epoch
readonly status: { readonly code: SpanStatusCode; readonly message?: string };
readonly attributes: Readonly<Record<string, string | number | boolean | string[]>>;
readonly events: readonly ISpanEventRecord[];
}
/**
* A single event on a span.
*/
export interface ISpanEventRecord {
readonly name: string;
readonly timestamp: number; // milliseconds since epoch
readonly attributes?: Readonly<Record<string, string | number | boolean | string[]>>;
}