Skip to content

Commit

Permalink
Update template for alert summary with new log pattern tools (#1021)
Browse files Browse the repository at this point in the history
* Update template for alert summary with log pattern

Signed-off-by: Sihan He <[email protected]>

* Update ChangeLog

Signed-off-by: Sihan He <[email protected]>

---------

Signed-off-by: Sihan He <[email protected]>
Signed-off-by: Vikas Adyar <[email protected]>
  • Loading branch information
000FLMS authored and vAdyar committed Feb 8, 2025
1 parent 7cde247 commit af06241
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
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))
### 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

0 comments on commit af06241

Please sign in to comment.