1 |
|
2 |
|
3 |
|
4 |
|
5 | export interface TelemetryEventProperties {
|
6 | readonly [key: string]: string;
|
7 | }
|
8 |
|
9 | export interface RawTelemetryEventProperties {
|
10 | readonly [key: string]: any;
|
11 | }
|
12 |
|
13 | export interface TelemetryEventMeasurements {
|
14 | readonly [key: string]: number;
|
15 | }
|
16 | export default class TelemetryReporter {
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | constructor(extensionId: string, extensionVersion: string, key: string, firstParty?: boolean);
|
24 |
|
25 | /**
|
26 | * Sends a telemetry event with the given properties and measurements
|
27 | * Properties are sanitized on best-effort basis to remove sensitive data prior to sending.
|
28 | * @param eventName The name of the event
|
29 | * @param properties The set of properties to add to the event in the form of a string key value pair
|
30 | * @param measurements The set of measurements to add to the event in the form of a string key number value pair
|
31 | */
|
32 | sendTelemetryEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
|
33 |
|
34 | /**
|
35 | * Sends a raw (unsanitized) telemetry event with the given properties and measurements
|
36 | * @param eventName The name of the event
|
37 | * @param properties The set of properties to add to the event in the form of a string key value pair
|
38 | * @param measurements The set of measurements to add to the event in the form of a string key number value pair
|
39 | */
|
40 | sendRawTelemetryEvent(eventName: string, properties?: RawTelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
|
41 |
|
42 | /**
|
43 | * Sends a telemetry error event with the given properties, measurements, and errorProps
|
44 | * @param eventName The name of the event
|
45 | * @param properties The set of properties to add to the event in the form of a string key value pair
|
46 | * @param measurements The set of measurements to add to the event in the form of a string key number value pair
|
47 | * @param errorProps A list of case sensitive properties to drop, if excluded we drop all properties but still send the event
|
48 | */
|
49 | sendTelemetryErrorEvent(eventName: string, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements, errorProps?: string[]): void;
|
50 |
|
51 | /**
|
52 | * Sends an exception which includes the error stack, properties, and measurements
|
53 | * @param error The error to send
|
54 | * @param properties The set of properties to add to the event in the form of a string key value pair
|
55 | * @param measurements The set of measurements to add to the event in the form of a string key number value pair
|
56 | */
|
57 | sendTelemetryException(error: Error, properties?: TelemetryEventProperties, measurements?: TelemetryEventMeasurements): void;
|
58 | dispose(): Promise<any>;
|
59 | }
|