src/vs/platform/agentHost/common/otel/agentHostOTelService.ts
46 LOC · 46 covered · 0 uncovered · 1 ranges · 386 concepts · 1 introducers · 171 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.
/*---------------------------------------------------------------------------------------------
copilotAgent.ts ×185
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type { TelemetryConfig } from '@github/copilot-sdk';
import type { URI } from '../../../../base/common/uri.js';
import { createDecorator } from '../../../instantiation/common/instantiation.js';
/**
* Lean service that wires the @github/copilot-sdk telemetry hook to either:
*
* - **External-only mode**: pass user-configured exporter settings straight through
* so the SDK's spawned CLI exports OTel data directly to the user's sink.
* - **DB mode** (`COPILOT_OTEL_DB_SPAN_EXPORTER_ENABLED=true`): point the SDK at a
* loopback OTLP/HTTP receiver, persist all spans into a local SQLite store, and
* optionally fan-out to a user-configured external sink as well.
*
* The interface lives in `common/` so consumers (DI registration, tests, callers
* in other layers) can import it without pulling in the node-only concrete
* implementation and its transitive native dependencies (`node:sqlite`).
*/
export interface IAgentHostOTelService {
readonly _serviceBrand: undefined;
/**
* Returns the telemetry config to hand to `new CopilotClient({ telemetry })`,
* starting the loopback receiver + store on first call when in DB mode.
* Resolves to `undefined` when telemetry is disabled.
*/
getSdkTelemetryConfig(): Promise<TelemetryConfig | undefined>;
/**
* Path of the SQLite span store, or `undefined` when DB mode is off.
*/
getSpansDbPath(): URI | undefined;
/**
* Drain any in-flight outbound forwarding. Safe to call concurrently with
* ongoing ingestion.
*/
flush(): Promise<void>;
}
export const IAgentHostOTelService = createDecorator<IAgentHostOTelService>('agentHostOTelService');