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

feat(awsq-telemetery): Update awsq_ metrics #595

Merged
merged 6 commits into from
Oct 27, 2023

Conversation

dianaabv16
Copy link
Contributor

@dianaabv16 dianaabv16 commented Oct 26, 2023

Problem

need to have awsq_ metrics individually, not under one entity like awsq_serviceInvocation, as we need to emit those metrics separately not all at once

Solution

License

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

@dianaabv16 dianaabv16 requested a review from a team as a code owner October 26, 2023 14:42
"name": "awsq_serviceErrors",
"description": "Number of errors from engineering and service availability?",
"unit": "Count",
"metadata": [{ "type": "awsqServiceErrorsCount" }]
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be needed. If it is, then there's something wrong with the application logic. Failed metrics in the application (Toolkit) should emit with Result=Failed

"name": "result",
"allowedValues": ["Succeeded", "Failed", "Cancelled"],

This is handled automatically if you structure the code to use telemetry.run() as documented in https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines 2641 to 2655
"unit": "Count",
"metadata": [{ "type": "awsqFilesChangedCount" }]
},
{
"name": "awsq_thumbsUp",
"description": "User clicked on the thumbs up button, to mention that they are satisfied",
"unit": "Count",
"metadata": [{ "type": "awsqThumbsUpCount" }]
},
{
"name": "awsq_thumbsDown",
"description": "User clicked on the thumbs down button to say that they are unsatisfied",
"unit": "Count",
"metadata": [{ "type": "awsqThumbsDownCount" }]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

in all of these cases, the unit: count declaration means the value can be set on the metric without the need for a special-purpose field (awsqFilesChangedCount, awsqThumbsUpCount, ...).

Please look at existing examples in this file, as well as usages in the Toolkit, to understand how things can be shaped.

For example, aws_loadCredentials has unit:Count :


and this is how it's used in the Toolkit (value: 1): https://github.com/aws/aws-toolkit-vscode/blob/61737287d918f777ea2e4a389ffea08fcc950adc/src/auth/providers/credentialsProviderManager.ts#L32

Copy link
Contributor Author

@dianaabv16 dianaabv16 Oct 26, 2023

Choose a reason for hiding this comment

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

from the example given it is not clear that the metadata value can be omitted.

 telemetry.aws_loadCredentials.emit({ credentialSourceId: telemType, value: 1 })

it seems like it increments on credentialSourceId.
I will remove Count values

@justinmk3 justinmk3 changed the title feart(awsq-telemetery): Update awsq_ metrics feat(awsq-telemetery): Update awsq_ metrics Oct 26, 2023
{
"name": "awsq_repo",
"description": "The size of the input repository",
"metadata": [{ "type": "awsqRepositorySize" }]
Copy link
Contributor

Choose a reason for hiding this comment

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

this metric could be "unit": "Count", then awsqRepositorySize is not needed.

Alternatively, please consider naming the type as filesize or directorysize so that it can be re-used in other metrics.

},
{
"name": "awsq_filesChanged",
"description": "The numbed of files suggested to change",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"description": "The numbed of files suggested to change",
"description": "Number of files suggested to change",

@jpinkney-aws jpinkney-aws merged commit 92dbbb6 into aws:main Oct 27, 2023
3 checks passed
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