Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Initial check-in for supporting telemetry in vscode #6123

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refine the operation detail part
  • Loading branch information
RodgeFu committed Feb 25, 2025
commit 76a47dffd0199cd8a599b9d591784ca8755e3fcf
8 changes: 3 additions & 5 deletions packages/typespec-vscode/src/telemetry/telemetry-client.ts
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@ import { isWhitespaceStringOrUndefined } from "../utils.js";
import {
emptyActivityId,
generateActivityId,
OperationDetailProperties,
OperationDetailTelemetryEvent,
OperationDetailPropertyName,
OperationTelemetryEvent,
TelemetryEventName,
} from "./telemetry-event.js";
@@ -117,11 +116,10 @@ class TelemetryClient {

public logOperationDetailTelemetry(
activityId: string,
detail: Partial<Record<keyof OperationDetailProperties, string>>,
detail: Partial<Record<keyof typeof OperationDetailPropertyName, string>>,
) {
const data: OperationDetailTelemetryEvent = {
const data = {
activityId: activityId,
eventName: TelemetryEventName.OperationDetail,
...detail,
};

15 changes: 5 additions & 10 deletions packages/typespec-vscode/src/telemetry/telemetry-event.ts
Original file line number Diff line number Diff line change
@@ -10,12 +10,6 @@ export enum TelemetryEventName {
ServerPathSettingChanged = "server-path-changed",
OperationDetail = "operation-detail",
}
export class OperationDetailProperties {
error = "error";
emitterPackage = "emitterPackage";
compilerLocation = "compilerLocation";
compilerVersion = "compilerVersion";
}

export interface TelemetryEventBase {
activityId: string;
@@ -29,10 +23,11 @@ export interface OperationTelemetryEvent extends TelemetryEventBase {
lastStep?: string;
}

export interface OperationDetailTelemetryEvent
extends TelemetryEventBase,
Partial<Record<keyof OperationDetailProperties, string>> {
eventName: TelemetryEventName.OperationDetail;
export enum OperationDetailPropertyName {
error,
emitterPackage,
compilerLocation,
compilerVersion,
}

export function generateActivityId() {
Loading
Oops, something went wrong.