Skip to content

Comments

adds support for sending PDP Events via o11y @W-21179952#469

Merged
shetzel merged 6 commits intomainfrom
sh/pft-telemetry
Feb 8, 2026
Merged

adds support for sending PDP Events via o11y @W-21179952#469
shetzel merged 6 commits intomainfrom
sh/pft-telemetry

Conversation

@shetzel
Copy link
Contributor

@shetzel shetzel commented Feb 5, 2026

What does this PR do?

adds support for sending PDP Events via o11y.
adds dependency on o11y_schema package to use the pdpEventSchema.

What issues does this PR fix or reference?

@W-21179952@

Copy link
Collaborator

@smuduganti-sf smuduganti-sf left a comment

Choose a reason for hiding this comment

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

LGTM. I initially expected sendPdpEvent to live in plugin-telemetry, but given that PdpEvent is feature-agnostic, keeping it in the telemetry library also makes sense. I’d also suggest incorporating the change to sendTelemetryEventWithSchema, as this would improve schema handling more generally and support other events that rely on a defined o11ySchema. I’ve added a code snippet suggestions for sendTelemetryEventWithSchema that you can consider applying.

Separately, we need to update @salesforce/o11y-reporter to the latest version that includes the fix for logEventWithSchema, which hasn’t yet been published due to the npm token issue. @shetzel , I’ve followed up with you separately on this. Before merging this PR, we should bump to the updated @salesforce/o11y-reporter version that contains the fix.

Comment on lines 116 to 121
const merged = { ...this.commonProperties, ...attributes };

const eventData: { [key: string]: unknown } = {
eventName: `${this.extensionName}/${eventName}`,
...merged,
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const eventData: { [key: string]: unknown } = { ...attributes };

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just event specific attributes confined to the schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also bring in zod, build a zod schema from the o11y schema passed in, then parse the event data with the zod schema to ensure it conforms. This seems like a separate effort though.

Copy link
Collaborator

@smuduganti-sf smuduganti-sf Feb 6, 2026

Choose a reason for hiding this comment

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

The schema we pass in is the O11y encoding schema (from o11y_schema), not a JSON Schema, so we can’t reliably derive a zod schema from it here. Callers should validate attributes (e.g. with zod) before calling, using the same schema context they use when importing the schema.

Comment on lines 116 to 121
const merged = { ...this.commonProperties, ...attributes };

const eventData: { [key: string]: unknown } = {
eventName: `${this.extensionName}/${eventName}`,
...merged,
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just event specific attributes confined to the schema.

* Populate this if there is a unique component with your Event for which a distinct count would be a relevant metric
* E.g., campaignID → count the number of campaigns that were interacted with.
*/
componentId?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have any opinions on how dx should use these props, for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only this recommendation from the canvas. I'll update the doc with it.
CLI plugin command name (<pluginName.commandName>) or ext command name

src/types.ts Outdated
* action = Action the user takes in past tense. This should only be ONE word, in lower case
* Examples: processed, selected, sent, saved
*/
eventName: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

would you want it typed as ${string}.{string} or something tighter? Same idea with productFeatureId being aJC{$string}

@smuduganti-sf
Copy link
Collaborator

@shetzel Please update the @salesforce/o11y-reporter to the latest version : v1.7.3

@shetzel shetzel merged commit bd66a73 into main Feb 8, 2026
15 checks passed
@shetzel shetzel deleted the sh/pft-telemetry branch February 8, 2026 18:27
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.

3 participants