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

chore: update telemetry developer doc #5848

Merged
merged 5 commits into from
Sep 30, 2024

Conversation

gbockus-sf
Copy link
Contributor

@gbockus-sf gbockus-sf commented Sep 13, 2024

What does this PR do?

When QE'ing the a recent PR I had to dig into how to enabled local telemetry logging for both Dev mode & VSIX mode. This PR update the telemetry.md developer doc to capture the HOWTO.

What issues does this PR fix or reference?

#5849
Related to: @W-16207092@

Functionality Before

Doc was out of date

Functionality After

Doc is more accurate and how HOWTO for local telemetry files.

@gbockus-sf gbockus-sf requested a review from a team as a code owner September 13, 2024 23:02
@@ -4,9 +4,12 @@ Similar to what vscode does, we are reporting on certain events that happen in t

## How it works

All extensions leverage the telemetryService in `salesforce-vscode-core` extension in order to send data. The service in `salesforce-vscode-core` is responsible for showing an information message to users and properly initializing the service for other extensions in this repository to leverage. Similar to VSCode, we provide the user an opt out mechanism. We check that user settings `telemetry.enableTelemetry` and `salesforcedx-vscode-core.telemetry.enabled` are enabled before initializing the service.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was no longer accurate so I removed it.

There are several ways to disable telemetry for all Salesforce extensions.
- Turn off the Core Extension telemetry setting at the workspace `("salesforcedx-vscode-core.telemetry.enabled": false)`
- Disable SF CLI telemetry
- `sf config set disable-telemetry=true --global`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added specific list of how to disable telemetry

Copy link
Collaborator

Choose a reason for hiding this comment

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

we have not called out internal users use case here. is that intentional?

Copy link
Collaborator

Choose a reason for hiding this comment

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

wonder why we have 2 setting instead of just 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

heh...we really have 3, but the top level vscode setting is no longer valid since VSCode made a change to how to manage this (when did this change happen? no idea... I'm pretty sure before I was ever working on this product so at least 3 years ago).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I view these docs as general and the internal use case is specific to just SFDC users. Think we should call it out here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unless you see any downside to it, it will be good to capture it here so we know what to expect for internal users?

@@ -4,9 +4,12 @@ Similar to what vscode does, we are reporting on certain events that happen in t

## How it works

All extensions leverage the telemetryService in `salesforce-vscode-core` extension in order to send data. The service in `salesforce-vscode-core` is responsible for showing an information message to users and properly initializing the service for other extensions in this repository to leverage. Similar to VSCode, we provide the user an opt out mechanism. We check that user settings `telemetry.enableTelemetry` and `salesforcedx-vscode-core.telemetry.enabled` are enabled before initializing the service.
All extensions leverage the telemetryService in `salesforce-vscode-core` extension in order to send data.
Copy link
Collaborator

Choose a reason for hiding this comment

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

There were some extensions like visualforce and debugger telemetry that did something different. Do these extensions also leverage the core extension telemetry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just deleted the part I knew to be totally wrong. AFAIK every extension in the monorepo has it's own telemetry service created via the shared utils package, and external extensions to the monorepo use the core extension to get access to creating a TelemetryService. Can flush this out more.

@@ -15,3 +18,23 @@ Additionally, if telemetry is disabled for Salesforce CLI using the `disable-tel
- Create a telemetry service under src
- Initialize the telemetry service on the extension's `activate` call and initialize it using `salesforce-vscode-core` telemetry service
- Use the telemetry service where needed in the extension

## Logging telemetry to a file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Btw, I just noticed this slack thread https://salesforce-internal.slack.com/archives/C4LRHH0AD/p1726781465323499?thread_ts=1726780954.506789&cid=C4LRHH0AD where Pete mentions this setting for local telemetry "salesforcedx-vscode-apex.advanced": {
"localTelemetryLogging": "true"
},

Are we missing it in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't aware of that one. It's dev mod specific. Will add it.

@daphne-sfdc daphne-sfdc merged commit d658c22 into develop Sep 30, 2024
8 checks passed
@daphne-sfdc daphne-sfdc deleted the gbockus/update-docs-for-local-logging branch September 30, 2024 14:44
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