Skip to content

Conversation

@Hweinstock
Copy link
Contributor

@Hweinstock Hweinstock commented Feb 4, 2025

Problem

This metric is currently being spammed in telemetry at unusual volume. It is suspected that this is connected to this change: https://github.com/aws/aws-toolkit-vscode/pull/5979/files, but the connection is not yet clear.

Solution

  • use the withTelemetryContext decorator to emit a function_call metric to capture additional information. This metric should allow us to determine what is calling this function so much. Added techdebt test to remove this debugging information before the following release.
  • debounce the current emit line that is causing the high volume emission.

Future Work

  • debounce reimplements a special case of debounceWithCancel, these can be redone to reduce code and improve reliability.

  • 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.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

github-actions bot commented Feb 4, 2025

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@Hweinstock Hweinstock marked this pull request as ready for review February 4, 2025 21:22
@Hweinstock Hweinstock requested a review from a team as a code owner February 4, 2025 21:23
@jpinkney-aws
Copy link
Contributor

Is everyone spam calling this one? Can we create a build and run it locally for a day to see if we can fix it before the next release?

@Hweinstock
Copy link
Contributor Author

From the telemetry, it seems that there are many users spamming this one, but not everyone. Messed around with the toolkit for a while and wasn't able to determine source or notice any clear correlations with other metrics in telemetry. It does emit 4x on startup, and multiple times when the source of the credentials are changed. However, I can keep digging. Its possible adding the decorator in more places could be valuable.

}
const telemType = credentialsProviderToTelemetryType(providerType)
telemetry.aws_loadCredentials.emit({ credentialSourceId: telemType, value: refreshed.length })
const emitWithDebounce = cancellableDebounce(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this will work as you intend. I think you need to move this cancellableDebounce() call to a class parameter since this creates a new instance each time

private readonly providerFactories: CredentialsProviderFactory[] = []
private readonly providers: CredentialsProvider[] = []

@withTelemetryContext({ name: 'getAllCredentialsProvider', class: credentialsProviderManagerClassName, emit: true })
Copy link
Contributor

Choose a reason for hiding this comment

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

And this emits every call, possible chance this will be noisy. But it should hopefully not break anything before we remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I added a techdebt test to ensure we remove this.

@jpinkney-aws
Copy link
Contributor

Despite code freeze I think we should merge this one as well. Otherwise we will need to wait another week to further debug this problem

@jpinkney-aws jpinkney-aws merged commit 100eb07 into aws:master Feb 5, 2025
26 checks passed
@Hweinstock Hweinstock deleted the auth/telemetryDebugging branch February 5, 2025 16:26
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
…ormation (aws#6499)

## Problem
This metric is currently being spammed in telemetry at unusual volume.
It is suspected that this is connected to this change:
https://github.com/aws/aws-toolkit-vscode/pull/5979/files, but the
connection is not yet clear.

## Solution
- use the `withTelemetryContext` decorator to emit a `function_call`
metric to capture additional information. This metric should allow us to
determine what is calling this function so much. Added techdebt test to
remove this debugging information before the following release.
- debounce the current emit line that is causing the high volume
emission.


## Future Work 
- `debounce` reimplements a special case of `debounceWithCancel`, these
can be redone to reduce code and improve reliability.

---

- 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.

3 participants