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

fix: capture complete extension load time #5397

Merged
merged 39 commits into from
Mar 5, 2024

Conversation

peternhale
Copy link
Contributor

@peternhale peternhale commented Feb 5, 2024

  • Add utility function to vscode-utils that returns the activation event for a given extension from extension host log
  • At the beginning of each extension’s activate function
    -- Capture the timestamp of function entry
    -- Capture the timestamp of the extension activation event using util from vscode-utils
  • Send activation telemetry record with
    -- Time spent in activation function (this is the current data)
    -- Timestamp of activate function entry
    -- Timestamp of extension activation
    -- Time spent for activation (activate function exit timestamp - extension activation event timestamp) in milliseconds

AC:

  • vscode-utils provides a function that returns the ext host extension activation timestamp for the provided extension id
  • sendActivation telemetry method will accept
    -- Time spent in activation function (this is the current data)
    -- Timestamp of activate function entry
    -- Timestamp of extension activation
    -- Time spent for activation (activate function exit timestamp - extension activation event timestamp) in milliseconds
  • One should be able to visit AppInsights to verify the new data are available in the activation telemetry record

@W-14915912@

@peternhale peternhale marked this pull request as ready for review February 7, 2024 17:58
@peternhale peternhale requested a review from a team as a code owner February 7, 2024 17:58
Copy link
Member

@mingxuanzhangsfdx mingxuanzhangsfdx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work in apex debugger. It is also missed in visualforce & replay debugger.

@@ -61,7 +61,7 @@
],
"scripts": {
"bundle:extension": "npm run bundle:extension:build && npm run bundle:extension:copy",
"bundle:extension:build": "esbuild ./src/extension.ts --bundle --outfile=dist/index.js --format=cjs --platform=node --external:vscode --minify",
"bundle:extension:build": "esbuild ./src/extension.ts --bundle --outfile=dist/index.js --format=cjs --platform=node --external:vscode --external:@salesforce/source-tracking --external:@salesforce/core",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops...shouldn't have removed --minify. This was a debugging step

@@ -659,7 +658,7 @@ export async function activate(extensionContext: vscode.ExtensionContext) {
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This object is where you can add modules to expose in the API of the extension.

Copy link
Contributor

@gbockus-sf gbockus-sf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loving the consoladation of the TelemetryService. I do think it's the right thing to just have every extension get the TelemetryService from the core extension API. This saves us from having to add the vscode-utils package to the VF extension.

…into phale/w-14915912-update-telemetry

# Conflicts:
#	packages/salesforcedx-vscode-core/src/index.ts
Copy link
Contributor

@CristiCanizales CristiCanizales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of nits

peternhale and others added 3 commits February 19, 2024 05:27
…er.ts

Co-authored-by: Cristina Cañizales <113132642+CristiCanizales@users.noreply.github.com>
Co-authored-by: Cristina Cañizales <113132642+CristiCanizales@users.noreply.github.com>
@CristiCanizales
Copy link
Contributor

QE notes:
Confirmed the data is being sent to AppInsights ✅
image

Copy link
Contributor

@CristiCanizales CristiCanizales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

:shipit:

…into phale/w-14915912-update-telemetry

# Conflicts:
#	packages/salesforcedx-utils-vscode/src/services/telemetry.ts
#	packages/salesforcedx-utils-vscode/src/telemetry/reporters/appInsights.ts
#	packages/salesforcedx-utils-vscode/test/jest/telemetry/telemetryReporter.test.ts
Copy link
Member

@mingxuanzhangsfdx mingxuanzhangsfdx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@peternhale peternhale merged commit 94e85e3 into develop Mar 5, 2024
12 checks passed
@peternhale peternhale deleted the phale/w-14915912-update-telemetry branch March 5, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants