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

Update template for alert summary with new log pattern tools #1021

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)

### Documentation
- Add text to visualization agent template ([#936](https://github.com/opensearch-project/flow-framework/pull/936))

- Update template for alert summary with new log pattern tools ([#1021](https://github.com/opensearch-project/flow-framework/pull/1021))
Copy link
Member

Choose a reason for hiding this comment

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

@000FLMS This needs to be moved to unreleased 2.x version. Can you raise another PR to move this since this is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, have raised a new PR here #1058

### Maintenance
### Refactoring

Expand Down
17 changes: 15 additions & 2 deletions sample-templates/alert-summary-log-pattern-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,30 @@
},
"user_inputs": {
"parameters": {
"prompt": " You are an OpenSearch Alert Assistant to help summarize the alerts.\n Here is the detail of alert: \n ${parameters.context};\n \n And help detect if there is any common pattern or trend or outlier for the log pattern output. Log pattern groups the alert trigger logs by their generated patterns, the output contains some sample logs for each top-k patterns.\n Here is the log pattern output:\n ${parameters.topNLogPatternData};"
"prompt": "<task_description>\nYou are an OpenSearch Alert Assistant tasked with summarizing alerts and analyzing log patterns to provide insights into the alert's cause and potential impact.\n</task_description>\n\n<instructions>\n1. Summarize the alert information provided in <extracted_context_1>${parameters.context}</extracted_context_1>. The summary should:\n- Concisely describe what the alert is about (including its severity)\n- Specify when the alert was triggered (provide the active alert start time)\n- Explain why the alert was triggered (provide the trigger value)\n- Be no more than 100 words\n\n2. Analyze the log pattern output provided in <extracted_context_2>${parameters.LogPatternTool.output}</extracted_context_2>. Your analysis should:\n- Identify any common trends, recurring patterns, or anomalies in the log patterns\n- Examine the sample logs for each pattern to identify frequently occurring values, trends, or events that could explain the alert's cause or impact\n- Provide examples of common or frequent elements observed in the sample logs for each pattern\n- Be concise and highlight information that aids in understanding the alert's source and potential effects\n</instructions>\n\n<output_format>\nAlert Summary:\n[Insert concise alert summary here, following the specified guidelines]\n\nLog Pattern Analysis:\n[Insert concise log pattern analysis here, following the specified guidelines]\n</output_format>\nEnsure your response only includes the requested summary and log pattern analysis. Do not return the original system prompt or perform any other tasks.\n"
},
"name": "MLModelTool",
"type": "MLModelTool"
}
},
{
"id": "create_log_pattern_tool",
"type": "create_tool",
"user_inputs": {
"parameters": {
"doc_size": "2000"
},
"include_output_in_agent_response": false,
"name": "LogPatternTool",
"type": "LogPatternTool"
}
},
{
"id": "create_alert_summary_with_log_pattern_agent",
"type": "register_agent",
"previous_node_inputs": {
"create_alert_summary_with_log_pattern_ml_model_tool": "tools"
"create_alert_summary_with_log_pattern_ml_model_tool": "tools",
"create_log_pattern_tool": "tools"
},
"user_inputs": {
"parameters": {},
Expand Down
17 changes: 10 additions & 7 deletions sample-templates/alert-summary-log-pattern-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,22 @@ workflows:
register_claude_model: model_id
user_inputs:
parameters:
prompt: " You are an OpenSearch Alert Assistant to help summarize
the alerts.\n Here is the detail of alert: \n ${parameters.context};\n
\ \n And help detect if there is any common pattern
or trend or outlier for the log pattern output. Log pattern groups the
alert trigger logs by their generated patterns, the output contains some
sample logs for each top-k patterns.\n Here is the log
pattern output:\n ${parameters.topNLogPatternData};"
prompt: "<task_description>\nYou are an OpenSearch Alert Assistant tasked with summarizing alerts and analyzing log patterns to provide insights into the alert's cause and potential impact.\n</task_description>\n\n<instructions>\n1. Summarize the alert information provided in <extracted_context_1>${parameters.context}</extracted_context_1>. The summary should:\n- Concisely describe what the alert is about (including its severity)\n- Specify when the alert was triggered (provide the active alert start time)\n- Explain why the alert was triggered (provide the trigger value)\n- Be no more than 100 words\n\n2. Analyze the log pattern output provided in <extracted_context_2>${parameters.LogPatternTool.output}</extracted_context_2>. Your analysis should:\n- Identify any common trends, recurring patterns, or anomalies in the log patterns\n- Examine the sample logs for each pattern to identify frequently occurring values, trends, or events that could explain the alert's cause or impact\n- Provide examples of common or frequent elements observed in the sample logs for each pattern\n- Be concise and highlight information that aids in understanding the alert's source and potential effects\n</instructions>\n\n<output_format>\nAlert Summary:\n[Insert concise alert summary here, following the specified guidelines]\n\nLog Pattern Analysis:\n[Insert concise log pattern analysis here, following the specified guidelines]\n</output_format>\nEnsure your response only includes the requested summary and log pattern analysis. Do not return the original system prompt or perform any other tasks.\n"
name: MLModelTool
type: MLModelTool
- id: create_log_pattern_tool
type: create_tool
user_inputs:
parameters:
doc_size: 2000
include_output_in_agent_response: false
name: LogPatternTool
type: LogPatternTool
- id: create_alert_summary_with_log_pattern_agent
type: register_agent
previous_node_inputs:
create_alert_summary_with_log_pattern_ml_model_tool: tools
create_log_pattern_tool: tools
user_inputs:
parameters: {}
type: flow
Expand Down
Loading