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

chore: improve types and documentation for telemetry #6176

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

mcasimir
Copy link
Collaborator

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@@ -1509,10 +1509,6 @@ export const connect = (
track(
'Connection Attempt',
{
is_favorite: connectionInfo.savedConnectionType === 'favorite',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

drive by, these attributes aren't meaningful anymore with multiple connections

Copy link
Contributor

@lerouxb lerouxb Sep 3, 2024

Choose a reason for hiding this comment

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

Are they, though? We still have the concept of a favourite that we haven't removed. Can't ever remove it if we don't keep stats on whether it gets used.

Copy link
Contributor

Choose a reason for hiding this comment

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

Relevant thread

I suggested removing them because the significance of is_favorite is not the same as it was before. Earlier is_favorite was the only way to differentiate wether a connection is saved or recent but now all the connections are saved and is_favorite is more UI related, allowing us to group connections together. So for the telemetry point that it used to represent earlier, it does not make sense to keep it anymore. However if we would like to track connections being marked as favorite maybe we can introduce a different attribute?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ahh ok, so is favorite is still a thing, then i will keep it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

and is recent doesn't make sense because everything saved now right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think is_recent can be dropped, yes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok re-added is_favorite then! thanks!

@@ -489,7 +489,7 @@ class CrudStoreImpl
* to update if the labels change at some point.
*/
modeForTelemetry() {
return this.state.view.toLowerCase();
return this.state.view.toLowerCase() as 'list' | 'json' | 'table';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is there a better way?

Copy link
Contributor

Choose a reason for hiding this comment

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

as Lowercase<DocumentView>?

@@ -143,7 +143,7 @@ export const StageEditor = ({
{
num_stages: num_stages,
stage_index: index + 1,
stage_action: 'stage_content_changed',
stage_action: 'stage_content_changed' as const,
Copy link
Contributor

@lerouxb lerouxb Sep 3, 2024

Choose a reason for hiding this comment

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

I'm not understanding what these as const bits are doing and why they would be necessary. Why not give the whole object a type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as in move as const at the end? They are there so stage_action is not considered a string

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah wait, you are right this should not be needed here though. I'll take another look and remove them where is redundant

@mcasimir mcasimir merged commit bea9599 into main Sep 10, 2024
27 checks passed
@mcasimir mcasimir deleted the more-telemetry-events branch September 10, 2024 08:01
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.

4 participants