2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { Disposable, MutableDisposable, toDisposable } from '../../../base/common/lifecycle.js';
7
>
import type { IRequestService } from '../../request/common/request.js';
8
>
import type { ICommonProperties } from '../../telemetry/common/telemetry.js';
9
>
import { OneDataSystemAppender } from '../../telemetry/node/1dsAppender.js';
10
>
import type { IAgentHostInternalTelemetryContext, IAgentHostInternalTelemetrySink, TelemetryMeasurements, TelemetryProps } from './agentHostRestrictedTelemetry.js';
11
>
12
>
// Public instrumentation key shipped as internalLargeStorageAriaKey in extensions/copilot/package.json.
13
>
const INTERNAL_LARGE_STORAGE_ARIA_KEY = 'ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917';
14
>
const INTERNAL_EVENT_PREFIX = 'GitHub.copilot-chat';
15
>
const INTERNAL_EXTENSION_ID = 'GitHub.copilot-chat';
16
>
17
>
interface IInternalTelemetryAppender {
18
>
log(eventName: string, data?: object): void;
19
>
flush(): Promise<void>;
20
>
}
21
>
22
>
interface IAgentHostInternalTelemetrySenderOptions {
23
>
readonly requestService?: IRequestService;
24
>
readonly commonProperties?: ICommonProperties;
25
>
readonly extensionVersion?: string;
26
>
readonly createAppender?: (requestService: IRequestService | undefined, commonProperties: ICommonProperties | undefined, eventPrefix: string) => IInternalTelemetryAppender;
27
>
}
28
>
29
function getInternalCommonProperties(commonProperties: ICommonProperties | undefined, extensionVersion: string | undefined): ICommonProperties | undefined {
30
if (!commonProperties) {