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

doc: update metric naming spec #984

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions telemetry/telemetryformat.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,20 @@ _types_ is an array that holds telemetry metadata types. This is the information

### Metrics

_metrics_ is an array that contains the actual metrics posted to the service. `name` defines the metric name what is
posted to the service, `metadata` contains data from `types` that define characteristics of the telemetry beyond
`createTime` and a `value`. `name` must be in the format`namespace_camelCaseName` (e.g. `s3_uploadObject`). The field is optional.
_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`)
Copy link
Contributor

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.

- 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`
Copy link
Contributor

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?

Copy link
Contributor Author

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

- NOTE: due to legacy reasons the above spec may not be followed, but all future definitions must follow it.
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
- 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.

- `description` explains what the metric means
- 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.
Copy link
Contributor

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.

- `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.
Copy link
Contributor

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.

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


```
"metrics": [
Expand Down