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

telemetry(lsp): standardize setup metric and types #961

Merged
merged 14 commits into from
Jan 23, 2025

Conversation

Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Jan 21, 2025

Problem

Relevant PR: aws/aws-toolkit-vscode#6385

Solution

  • standardize the metrics across the toolkits.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Hweinstock Hweinstock force-pushed the hkobew/lspSetupTelemetry branch from bd211fd to 911286f Compare January 22, 2025 16:36
@Hweinstock Hweinstock marked this pull request as ready for review January 22, 2025 16:42
@Hweinstock Hweinstock requested a review from a team as a code owner January 22, 2025 16:42
telemetry/definitions/commonDefinitions.json Outdated Show resolved Hide resolved
telemetry/definitions/commonDefinitions.json Outdated Show resolved Hide resolved
{
"name": "languageServer_setup",
"description": "LSP setup event",
"metadata": [
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a passive event because users do not take an actual action for this to occur, please indicate the same. In addition fields of duration and result is missing from this shape

Copy link
Contributor Author

@Hweinstock Hweinstock Jan 22, 2025

Choose a reason for hiding this comment

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

I thought these were global arguments so they would be automatically populated?

Is it still required to add them to the shape as well?

Also found in the VS generator I think? https://github.com/aws/aws-toolkit-common/blob/ab466029f241193ab93a8abb3a5ca8dde5f56c94/telemetry/csharp/AwsToolkit.Telemetry.Events/Core/BaseTelemetryEvent.cs#L90C24-L90C32

Copy link
Contributor

Choose a reason for hiding this comment

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

Duration is implicit with the C# generator, but we don't have support for result, so this field needs to be added to the metadata.

Copy link
Contributor

Choose a reason for hiding this comment

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

but we don't have support for result, so this field needs to be added to the metadata.

Can that be prioritized? Adding result explicitly to every metric confuses the messaging for partner teams.

@Hweinstock Hweinstock changed the title telemetry(lsp): port language server setup metric and types from vscode to commons. telemetry(lsp): standardize setup metric and types Jan 22, 2025
"description": "The location of the manifest"
},
{
"name": "manifestSchemaVersion",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change, this definitely is less ambiguous.

@Hweinstock Hweinstock merged commit 745792c into aws:main Jan 23, 2025
8 checks passed
@Hweinstock Hweinstock deleted the hkobew/lspSetupTelemetry branch January 23, 2025 20:14
jpinkney-aws pushed a commit to aws/aws-toolkit-vscode that referenced this pull request Feb 6, 2025
…#6385)

## Problem
LSP downloading processes does not emit any telemetry. 

## Solution

### Refactoring
- separate verification from core downloading steps so that we can
capture it as its own telemetry event.
- Note: this refactor means that if all the downloaded content cannot be
verified, no files will be written to disk.
- Introduce abstraction of `StageResolver` to make telemetry
instrumentation more natural.

### Metric Behavior
- metric for each stage of the LSP setup process.
- can be emitted multiple times per stage to capture specific error
codes. See tests for examples.
- Commons repo PR: aws/aws-toolkit-common#961
- bumped commons version to
[1.0.296](aws/aws-toolkit-common@8df7a87)
to include this change.

### Testing
- adds basic tests for `ManifestResolver` in
`packages/core/src/test/shared/lsp/manifestResolver.test.ts`.
- adds basic tests for `LanguageServerResolver` in
`packages/core/src/test/shared/lsp/lspResolver.test.ts`.
- Currently `LanguageServerResolver` only supports mac, so its tests
skip on non-mac platforms. There is a techdebt test to address this.

## Future Work
- Update logging messages to be LSP specific. 

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
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.

5 participants