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

Telemetry: At Mentions #5558

Merged
merged 12 commits into from
Oct 2, 2024
Merged

Conversation

RXminuS
Copy link
Contributor

@RXminuS RXminuS commented Sep 11, 2024

Before the cody.at-mention event fired as soon as the chat view was rendered leading to an overcount of DAUs. Duplicate mention events were also fired for other mention providers such as when typing a file name where each character would fire an event.

Now events only fire when actually triggered. We also clean up and add additional public metadata that can help evaluate the actual effectiveness of different mention providers.

Fixes CODY-3405

Test plan

  • Added new Telemetry testing framework. Run cd vscode & pnpm run test:e2e2 --grep "telemetry.
  • See the snapshots to view the included data

Changelog

@RXminuS RXminuS mentioned this pull request Sep 11, 2024
Copy link
Contributor Author

RXminuS commented Sep 11, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @RXminuS and the rest of your teammates on Graphite Graphite

@RXminuS RXminuS mentioned this pull request Sep 11, 2024
@RXminuS RXminuS changed the title WIP At Mention Telemetry Sep 11, 2024
@RXminuS RXminuS changed the title At Mention Telemetry At-Mention Telemetry Sep 11, 2024
Copy link

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

@RXminuS RXminuS changed the title At-Mention Telemetry Telemetry: @-mention & testing framework Sep 11, 2024
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from 0265798 to ec7b187 Compare September 13, 2024 21:25
@RXminuS RXminuS requested review from akalia25 and a team September 13, 2024 21:39
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from ec7b187 to aa7f4a1 Compare September 18, 2024 06:00
@RXminuS RXminuS mentioned this pull request Sep 18, 2024
Copy link
Contributor

@akalia25 akalia25 left a comment

Choose a reason for hiding this comment

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

Left a few clarifying comments :)

lib/shared/src/prompt/truncation.ts Outdated Show resolved Hide resolved
vscode/src/chat/chat-view/ChatController.ts Outdated Show resolved Hide resolved
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch 2 times, most recently from b123bcf to 7bf10dd Compare September 24, 2024 11:20
@RXminuS RXminuS changed the base branch from rnauta/e2ev2/migrate-tests to rnauta/e2ev2/baseline-framework September 24, 2024 11:20
@RXminuS RXminuS changed the title Telemetry: @-mention & testing framework Telemetry: At Mentions Sep 24, 2024
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from 7bf10dd to b9204ba Compare September 24, 2024 12:54
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 4e1ed31 to d86e4b6 Compare September 30, 2024 23:04
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from b9204ba to 1b2a1f8 Compare September 30, 2024 23:04
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from d86e4b6 to 3b09ee8 Compare October 1, 2024 00:26
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from 1b2a1f8 to 1aeed23 Compare October 1, 2024 00:26
@RXminuS RXminuS marked this pull request as ready for review October 1, 2024 00:31
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch 2 times, most recently from 661fc38 to 12283bc Compare October 2, 2024 12:33
Base automatically changed from rnauta/e2ev2/baseline-framework to main October 2, 2024 12:52
@RXminuS RXminuS force-pushed the rnauta/bug-bash/cody-3405-at-mention-telemetry branch from 1aeed23 to 0b95742 Compare October 2, 2024 13:58
@RXminuS
Copy link
Contributor Author

RXminuS commented Oct 2, 2024

@akalia25 what do you want to do with those failing telemetry events in the other tests?

Can we somehow just remove the event from the general checks as we can do more detailed testing now? Or do I have to go in and update them all?

Copy link
Contributor

@akalia25 akalia25 left a comment

Choose a reason for hiding this comment

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

Left a few comments regarding the collection of transcripts, and changes introduced to that. After those, I can approve :)

repoMetadata,
repoIsPublic,
traceId: span.spanContext().traceId,
promptText: inputText,
Copy link
Contributor

Choose a reason for hiding this comment

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

For the collection of transcript data, we'd need to do the same isDotCom() check that was happening before, is this happening somewhere else in the code now?

The reason for this is two-fold, first prevents the local PG instance from storing this data and increasing db load and second for additional security around this sensitive data.

Suggested change
promptText: inputText,
promptText:
isDotCom(authStatus) &&
(await truncatePromptString(inputText, CHAT_INPUT_TOKEN_BUDGET)),
},

vscode/src/chat/chat-view/ChatController.ts Show resolved Hide resolved
@akalia25
Copy link
Contributor

akalia25 commented Oct 2, 2024

@akalia25 what do you want to do with those failing telemetry events in the other tests?

Can we somehow just remove the event from the general checks as we can do more detailed testing now? Or do I have to go in and update them all?

hmm I'd love to have those updated 😅 , those have been critical in us spot-checking events. Happy to assist and update them as well!

Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

manually tested

@RXminuS RXminuS dismissed akalia25’s stale review October 2, 2024 16:59

Asked @jan Hartman before and he said the prompt text wasn't used. For now we're prioritizing making sure DAU count is correct. We can easily add back prompt text back later.

@RXminuS RXminuS enabled auto-merge (squash) October 2, 2024 17:02
@RXminuS RXminuS merged commit e856706 into main Oct 2, 2024
19 checks passed
@RXminuS RXminuS deleted the rnauta/bug-bash/cody-3405-at-mention-telemetry branch October 2, 2024 17:20
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