[8.16] [Security assistant] Fix invoke_assistant_success telemetry schema (#204280) (#204454)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security assistant] Fix `invoke_assistant_success ` telemetry schema
(#204280)](https://github.com/elastic/kibana/pull/204280)

<!--- Backport version: 8.9.8 -->

### 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":"2024-12-16T17:00:59Z","message":"[Security
assistant] Fix `invoke_assistant_success ` telemetry schema
(#204280)","sha":"86fe148e963f2afaaa02cc1160a58bb959904a5c","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:
SecuritySolution","backport:prev-major","Team:Security Generative
AI"],"number":204280,"url":"https://github.com/elastic/kibana/pull/204280","mergeCommit":{"message":"[Security
assistant] Fix `invoke_assistant_success ` telemetry schema
(#204280)","sha":"86fe148e963f2afaaa02cc1160a58bb959904a5c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204280","number":204280,"mergeCommit":{"message":"[Security
assistant] Fix `invoke_assistant_success ` telemetry schema
(#204280)","sha":"86fe148e963f2afaaa02cc1160a58bb959904a5c"}},{"url":"https://github.com/elastic/kibana/pull/204451","number":204451,"branch":"8.x","state":"OPEN"}]}]
BACKPORT-->

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Steph Milovic 2024-12-17 14:24:18 -07:00 committed by GitHub
parent 56eea8f876
commit 2699f170c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,13 +77,16 @@ export const INVOKE_ASSISTANT_SUCCESS_EVENT: EventTypeOpts<{
actionTypeId: string;
isEnabledKnowledgeBase: boolean;
durationMs: number;
['toolsInvoked.AlertCountsTool']?: number;
['toolsInvoked.NaturalLanguageESQLTool']?: number;
['toolsInvoked.KnowledgeBaseRetrievalTool']?: number;
['toolsInvoked.KnowledgeBaseWriteTool']?: number;
['toolsInvoked.OpenAndAcknowledgedAlertsTool']?: number;
['toolsInvoked.SecurityLabsKnowledgeBaseTool']?: number;
['toolsInvoked.CustomTool']?: number;
toolsInvoked: {
AlertCountsTool?: number;
NaturalLanguageESQLTool?: number;
KnowledgeBaseRetrievalTool?: number;
KnowledgeBaseWriteTool?: number;
OpenAndAcknowledgedAlertsTool?: number;
SecurityLabsKnowledgeBaseTool?: number;
ProductDocumentationTool?: number;
CustomTool?: number;
};
model?: string;
isOssModel?: boolean;
}> = {
@ -127,53 +130,64 @@ export const INVOKE_ASSISTANT_SUCCESS_EVENT: EventTypeOpts<{
description: 'The duration of the request.',
},
},
'toolsInvoked.AlertCountsTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.NaturalLanguageESQLTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.KnowledgeBaseRetrievalTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.KnowledgeBaseWriteTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.OpenAndAcknowledgedAlertsTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.SecurityLabsKnowledgeBaseTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
'toolsInvoked.CustomTool': {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
toolsInvoked: {
properties: {
AlertCountsTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
NaturalLanguageESQLTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
ProductDocumentationTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
KnowledgeBaseRetrievalTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
KnowledgeBaseWriteTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
OpenAndAcknowledgedAlertsTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
SecurityLabsKnowledgeBaseTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
CustomTool: {
type: 'long',
_meta: {
description: 'Number of times tool was invoked.',
optional: true,
},
},
},
},
},