Skip to content

Commit

Permalink
[Security assistant] Fix invoke_assistant_success telemetry schema (
Browse files Browse the repository at this point in the history
…elastic#204280)

(cherry picked from commit 86fe148)
  • Loading branch information
stephmilovic committed Dec 16, 2024
1 parent 87f9d77 commit 0850111
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}> = {
Expand Down Expand Up @@ -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,
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { KNOWLEDGE_BASE_RETRIEVAL_TOOL } from './knowledge_base/knowledge_base_r
import { KNOWLEDGE_BASE_WRITE_TOOL } from './knowledge_base/knowledge_base_write_tool';
import { SECURITY_LABS_KNOWLEDGE_BASE_TOOL } from './security_labs/security_labs_tool';

// any new tool should also be added to telemetry schema in
// x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts
export const assistantTools = [
ALERT_COUNTS_TOOL,
DEFEND_INSIGHTS_TOOL,
Expand Down

0 comments on commit 0850111

Please sign in to comment.