@itwin/core-telemetry
Version:
iTwin.js Telemetry Client
65 lines • 2.33 kB
TypeScript
/** @packageDocumentation
* @module Telemetry
*/
import { GuidString } from "@itwin/core-bentley";
import { RpcActivity } from "@itwin/core-common";
/** Represents a particular occurrence of an event that can be tracked through various telemetry services
* @internal
*/
export declare class TelemetryEvent {
/** Human-readable name for the event being tracked */
readonly eventName: string;
/**
* Optional Guid that can be used to more accurately identify the telemetry event.
* This field is required when posting a telemetry event as feature usage to ULAS.
*/
readonly eventId?: GuidString | undefined;
/** iModel parent iTwin id */
readonly iTwinId?: GuidString | undefined;
readonly iModelId?: GuidString | undefined;
readonly changeSetId?: GuidString | undefined;
readonly time?: {
startTime: Date;
endTime: Date;
} | undefined;
/** Custom properties */
readonly additionalProperties: {
[key: string]: any;
};
constructor(
/** Human-readable name for the event being tracked */
eventName: string,
/**
* Optional Guid that can be used to more accurately identify the telemetry event.
* This field is required when posting a telemetry event as feature usage to ULAS.
*/
eventId?: GuidString | undefined,
/** iModel parent iTwin id */
iTwinId?: GuidString | undefined, iModelId?: GuidString | undefined, changeSetId?: GuidString | undefined, time?: {
startTime: Date;
endTime: Date;
} | undefined,
/** Custom properties */
additionalProperties?: {
[key: string]: any;
});
/**
* Returns all properties as a new object
*/
getProperties(): {
[key: string]: any;
};
}
/** @internal */
export interface TelemetryClient {
postTelemetry(requestContext: RpcActivity, telemetryEvent: TelemetryEvent): Promise<void>;
}
/** @internal */
export declare class TelemetryManager {
protected readonly _clients: Set<TelemetryClient>;
constructor(...clients: TelemetryClient[]);
postTelemetry(requestContext: RpcActivity, telemetryEvent: TelemetryEvent): Promise<void>;
addClient(client: TelemetryClient): void;
hasClient(client: TelemetryClient): boolean;
}
//# sourceMappingURL=TelemetryClient.d.ts.map