-
Notifications
You must be signed in to change notification settings - Fork 53
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
doc: update metric naming spec #984
base: main
Are you sure you want to change the base?
Conversation
See changes for the new spec when it comes to metric naming. - This will NOT retroactively apply to all existing metrics since this will require significant work refactoring that we do not want to do at the moment. Signed-off-by: nkomonen-amazon <[email protected]>
telemetry/telemetryformat.md
Outdated
what the metric actually means and how it should be used. | ||
- `metadata` contains data from `types` that define characteristics of the telemetry beyond | ||
`createTime` and a `value`. | ||
- This field is optional, but default `types` are automatically added regardless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know they are called types but I imagine this will be confusing to read.
- This field is optional, but default `types` are automatically added regardless. | |
- This field is optional, but default fields (`types`) are always present on generated metrics. |
telemetry/telemetryformat.md
Outdated
- Common Namespaces: | ||
- `toolkit_` is for general non-feature-specific metrics created by the toolkit. Eg: `toolkit_moduleOpen` | ||
- `ide_` is for IDE specific metrics, not controlled by our extension. Eg: `ide_editorOpen` | ||
- NOTE: due to legacy reasons the above spec may not be followed, but all future definitions must follow it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- NOTE: due to legacy reasons the above spec may not be followed, but all future definitions must follow it. | |
- NOTE: legacy metrics don't always follow the above rules, but new definitions must follow it. |
telemetry/telemetryformat.md
Outdated
- put effort to explaining the metrics purpose in detail. This tends to be the source of truth for | ||
what the metric actually means and how it should be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is also the only way we have to signal "deprecated", currently.
_metrics_ is an array that contains the actual metrics posted to the service. | ||
- `name` defines the metric name | ||
- it must be in the format `namespace_camelCaseName` (e.g. `s3_objectUpload`). | ||
- it must be in the format `{namespace}_{noun}{Verb}` (eg: `toolkit_moduleInit`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some indented points explaining the rationale? As reviewers we will want to be able to link to this section of the doc to avoid repetition and pushback.
Signed-off-by: nkomonen-amazon <[email protected]>
- This format enables a natural grouping of related metrics in our definitions file, as well as improved searchability. | ||
- Common Namespaces: | ||
- `toolkit_` is for general non-feature-specific metrics created by the toolkit. Eg: `toolkit_moduleOpen` | ||
- `ide_` is for IDE specific metrics, not controlled by our extension. Eg: `ide_editorOpen` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also add an entry for ui_click?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you mean specifically?
IIUC we semi-agreed in a previous slack thread that with this new spec, toolkit_uiClick
would technically be the name that we go with if it didn't already exist
Problem
We do not have a clear defined format for metric names.
Solution
Update the doc that defines how to name a metric.
This will NOT retroactively apply to all existing metrics since this will require significant work refactoring that we do not want to do at the moment.
The benefits of this new structure
{namespace}_{noun}{Verb}
are that it will group related metrics in the definitions file since they are alphabetically ordered. Also when getting IDE completions all relevant options will be grouped together. This should help for searchability/reusability.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.