-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Security solution] Assistant telemetry conversation id fix #173794
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
💚 Build Succeeded
Metrics [docs]Async chunks
To update your PR or re-run it, just comment with: |
assistantTelemetry?.reportAssistantInvoked({ | ||
invokedBy: 'shortcut', | ||
conversationId: localStorageLastConversationId ?? WELCOME_CONVERSATION_TITLE, | ||
conversationId: getConversationId(), |
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.
Thanks for ensuring all code paths return a consistent id with the new getConversationId()
function!
The expected conversation id is included when the assistant is launched from the:
💹 Alerts flyout / page
💹 Data quality results / page
💹 Cases page
💹 Timeline
...and other contexts.
💹 The expected conversation ID is included for both default (e.g. Alert summary
) and Custom
conversations
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.
Thanks @stephmilovic for this telemetry update!
✅ Desk tested locally
LGTM 🚀
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…173794) (#173843) # Backport This will backport the following commits from `main` to `8.12`: - [[Security solution] Assistant telemetry conversation id fix (#173794)](#173794) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Steph Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2023-12-21T14:40:49Z","message":"[Security solution] Assistant telemetry conversation id fix (#173794)","sha":"574ff80c444fcaa2717f8578ba4af09c5a433c06","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team: SecuritySolution","Team:Threat Hunting:Explore","Feature:GenAI","v8.12.0","v8.13.0"],"number":173794,"url":"https://github.com/elastic/kibana/pull/173794","mergeCommit":{"message":"[Security solution] Assistant telemetry conversation id fix (#173794)","sha":"574ff80c444fcaa2717f8578ba4af09c5a433c06"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173794","number":173794,"mergeCommit":{"message":"[Security solution] Assistant telemetry conversation id fix (#173794)","sha":"574ff80c444fcaa2717f8578ba4af09c5a433c06"}}]}] BACKPORT--> Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Summary
We track telemetry when the AI Assistant button is clicked into, including the
conversationId
. However, when we introduced the new global header menu, theconversationId
got dropped. This PR fixes that by introducing a new method,getConversationId
that will default to thelocalStorageLastConversationId
and then the Welcome id if no local storage id is present. This method is shared anywhere theconversationId
is referenced.To test
telemetry.optIn: true
is defined in your dev ymlReport event "Assistant Invoked"
. Expand the event and find the id inproperties.conversationId
. Ensure that it is the same conversation that was openedReport event "Assistant Invoked"
. Expand the event and ensure the expectedproperties.conversationId
was sent