Skip to content

feat: pft telemetry @W-21233151#6848

Merged
mshanemc merged 11 commits intodevelopfrom
sm/pft
Feb 12, 2026
Merged

feat: pft telemetry @W-21233151#6848
mshanemc merged 11 commits intodevelopfrom
sm/pft

Conversation

@mshanemc
Copy link
Copy Markdown
Contributor

@mshanemc mshanemc commented Feb 11, 2026

What does this PR do?

send telemetry via o11y for PFT
records only commandExecution
sets the endpoint/PFT id for all of our extensions
support for 2PP extensions is them adding the correct props to pjson

What issues does this PR fix or reference?

@W-21233151@

QA notes: be sure to deactivate dev mode for testing locally

@mshanemc mshanemc requested a review from a team as a code owner February 11, 2026 17:04
@mshanemc mshanemc requested a review from randi274 February 11, 2026 17:04
Copy link
Copy Markdown
Contributor

@jonnyhork jonnyhork left a comment

Choose a reason for hiding this comment

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

I ran into a build error with npm run vscode:bundle, Claude offered some notes:

npm run vscode:bundle fails because the PR imports o11y_schema/sf_pdp in o11yReporter.ts and o11ySpanExporter.ts, but the o11y_schema package does not export sf_pdp. The Jest mock at config/__mocks__/o11y_schema_sf_pdp.js makes unit tests pass; esbuild fails when bundling extensions.

Fix: Add an alias in the bundle configs so the import resolves to the existing mock at bundle time:

  1. scripts/bundling/web.mjs — add to commonConfigBrowser.alias:
'o11y_schema/sf_pdp': join(__dirname, '../config/__mocks__/o11y_schema_sf_pdp.js'),
  1. scripts/bundling/node.mjs — import path/join and add an alias block:
alias: {
  'o11y_schema/sf_pdp': join(__dirname, '../config/__mocks__/o11y_schema_sf_pdp.js'),
}

Note: The mock exports { pdpEventSchema: {} }. Verify that @salesforce/o11y-reporter's logEventWithSchema works at runtime with this schema when running the web extension.

Comment on lines +90 to +91
contextName: 'orgId::devhubId',
contextValue: `${orgId}::${devHubId}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If these orgId and deHubId are not defined, we would still send undefined:undefined right?

Is there a way to omit the property if not defined instead? Not a big deal, but undefined tends to feel like an error to me or and possibly others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no, they show up as empty strings because of line 103/105

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you're going to love TS! because the types on the pft method are string for those props, it won't let you pass in undefined. You don't have to worry about stuff like that.

[there's also an eslint rule to keep people from using null/undefined stuff in template literals...we don't have it on but we could]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah those lines were hidden/collapsed by GitHub...

@jonnyhork
Copy link
Copy Markdown
Contributor

You demo video looked good in superset, I did not look for events myself, I have used Superset before but I'd have to dig up the links and query etc.

@mshanemc
Copy link
Copy Markdown
Contributor Author

I ran into a build error with npm run vscode:bundle, Claude offered some notes:

npm run vscode:bundle fails because the PR imports o11y_schema/sf_pdp in o11yReporter.ts and o11ySpanExporter.ts, but the o11y_schema package does not export sf_pdp. The Jest mock at config/__mocks__/o11y_schema_sf_pdp.js makes unit tests pass; esbuild fails when bundling extensions.

Fix: Add an alias in the bundle configs so the import resolves to the existing mock at bundle time:

  1. scripts/bundling/web.mjs — add to commonConfigBrowser.alias:
'o11y_schema/sf_pdp': join(__dirname, '../config/__mocks__/o11y_schema_sf_pdp.js'),
  1. scripts/bundling/node.mjs — import path/join and add an alias block:
alias: {
  'o11y_schema/sf_pdp': join(__dirname, '../config/__mocks__/o11y_schema_sf_pdp.js'),
}

Note: The mock exports { pdpEventSchema: {} }. Verify that @salesforce/o11y-reporter's logEventWithSchema works at runtime with this schema when running the web extension.

oh, that was interesting. I got it to work by unpinning the o11y versions (now ^) so they can all use latest. Previously, they'd have their own version in package-level node_modules and that pdp was on the package-level but not the repo-level o11y_schema. I think that's a lot cleaner than Claude's hacky idea

Copy link
Copy Markdown
Contributor

@jonnyhork jonnyhork left a comment

Choose a reason for hiding this comment

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

Bundling work for me now.

Comment on lines +90 to +91
contextName: 'orgId::devhubId',
contextValue: `${orgId}::${devHubId}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah those lines were hidden/collapsed by GitHub...

@mshanemc mshanemc merged commit 67dc279 into develop Feb 12, 2026
81 of 87 checks passed
@mshanemc mshanemc deleted the sm/pft branch February 12, 2026 21:20
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.

2 participants