Skip to content

[Assist] Add AssistAction and AssistAccessRequest PostHog event reporting#30513

Merged
jakule merged 3 commits intomasterfrom
jakule/assist-posthog
Aug 21, 2023
Merged

[Assist] Add AssistAction and AssistAccessRequest PostHog event reporting#30513
jakule merged 3 commits intomasterfrom
jakule/assist-posthog

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented Aug 15, 2023

This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.

@jakule jakule added the assist label Aug 15, 2023
@jakule jakule force-pushed the jakule/assist-posthog branch from 253ed27 to 6b8c33b Compare August 16, 2023 22:41
@jakule jakule marked this pull request as ready for review August 17, 2023 14:51
@github-actions github-actions Bot requested review from avatus and camscale August 17, 2023 14:51
@jakule jakule requested a review from hugoShaka August 17, 2023 17:10
Comment thread api/proto/teleport/usageevents/v1/usageevents.proto Outdated
Comment thread lib/web/assistant.go Outdated
@jakule jakule requested a review from hugoShaka August 17, 2023 20:22
Copy link
Copy Markdown
Contributor

@avatus avatus left a comment

Choose a reason for hiding this comment

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

+1 on not needing the username but rest looks fine to me

Comment thread lib/usagereporter/teleport/types.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this need some docs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from camscale August 17, 2023 21:12
jakule added 3 commits August 21, 2023 12:36
This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.
Both "AssistAccessRequest" and "AssistAction" messages in usageevents.proto file and their corresponding Go structures were modified to remove the "userName" field.
@jakule jakule force-pushed the jakule/assist-posthog branch from d74561c to 1ce9a9f Compare August 21, 2023 16:39
@jakule jakule added this pull request to the merge queue Aug 21, 2023
Merged via the queue into master with commit a2afac8 Aug 21, 2023
@jakule jakule deleted the jakule/assist-posthog branch August 21, 2023 19:05
jakule added a commit that referenced this pull request Aug 21, 2023
…ting (#30513)

* Add AssistAction and AssistAccessRequest PostHog event reporting

This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.

* "Removed userName in AssistAccessRequest and AssistAction"

Both "AssistAccessRequest" and "AssistAction" messages in usageevents.proto file and their corresponding Go structures were modified to remove the "userName" field.

* Add GoDoc
github-merge-queue Bot pushed a commit that referenced this pull request Aug 22, 2023
* assist: move embeddings in a separate library, add tool config, opportunistic node lookup (#29716)

* assist: extract embedding types into a dedicated module

* assist: allow the embedding tool to query nodes from proxy cache

This commit does two things:
- Introduce a new toolsConfig structure to pass all required clients to
  the tools. This can also be used to enable or disable specicifc tools,
  which helps with testing
- Pass the proxy node cache and the request access checker to the
  embedding tool so it can try to lookup nodes from cache in if the user
  has less than 10 nodes available.

* Add tests for the opportunistic proxy node lookup

* Apply suggestions from code review

* Update lib/ai/client.go

* [Assist] Add Assist to the terminal UI (#30496)

* Add Assist to the terminal UI

* Use getPlatform()

* Fix spacing beneath the message box

* [Assist] Add in SSH context Assist endpoints (#30319)

* Add in SSH context Assist endpoints

This change introduces web endpoints used by Assist to support in SSH context functionality in the WebUI. Now a user will be able to generate Bash command and explain output in the terminal (like application logs).

* Remove mockup web UI

* Make the linter happy

* Remove unnecessary comments and add missing documentation

This commit removes a redundant comment on the AI model selection in client.go that suggested a model change that is not needed. It also adds missing documentation in chat.go, to clarify the purpose and functionality of the Reply function.

* Revert ws.WriteControl to use real time.

Usage of the fake clock was failing the tests, and it's not really beneficial in this case.

* Replace caret symbol with Windows key in Terminal utility (#30642)

The caret symbol (^) previously used in the Terminal utility was not universally recognized or understanding. To increase usability, it has been replaced with the Windows key symbol (⊞). This should make the tool more intuitive to use for a wider range of users.

* [Assist] Add AssistAction and AssistAccessRequest PostHog event reporting (#30513)

* Add AssistAction and AssistAccessRequest PostHog event reporting

This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.

* "Removed userName in AssistAccessRequest and AssistAction"

Both "AssistAccessRequest" and "AssistAction" messages in usageevents.proto file and their corresponding Go structures were modified to remove the "userName" field.

* Add GoDoc

---------

Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>
Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants