Skip to content

Commit

Permalink
Pass top N log pattern data from alerting context provider to agent (#…
Browse files Browse the repository at this point in the history
…341) (#342)

(cherry picked from commit a6af310)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 6ab517e commit 11b8412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions public/components/incontext_insight/generate_popover_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const GeneratePopoverBody: React.FC<{
: undefined;
const index = contextObj?.additionalInfo?.index;
const dsl = contextObj?.additionalInfo?.dsl;
const topNLogPatternData = contextObj?.additionalInfo?.topNLogPatternData;

await httpSetup
?.post(SUMMARY_ASSISTANT_API.SUMMARIZE, {
Expand All @@ -114,6 +115,7 @@ export const GeneratePopoverBody: React.FC<{
context: contextContent,
index,
dsl,
topNLogPatternData,
}),
query: dataSourceQuery,
})
Expand Down
4 changes: 3 additions & 1 deletion server/routes/summary_routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function registerSummaryAssistantRoutes(
context: schema.maybe(schema.string()),
index: schema.maybe(schema.string()),
dsl: schema.maybe(schema.string()),
topNLogPatternData: schema.maybe(schema.string()),
}),
query: schema.object({
dataSourceId: schema.maybe(schema.string()),
Expand All @@ -45,14 +46,15 @@ export function registerSummaryAssistantRoutes(
});
const assistantClient = assistantService.getScopedClient(req, context);
const agentConfigId =
req.body.index && req.body.dsl
req.body.index && req.body.dsl && req.body.topNLogPatternData
? LOG_PATTERN_SUMMARY_AGENT_CONFIG_ID
: SUMMARY_AGENT_CONFIG_ID;
const response = await assistantClient.executeAgentByConfigName(agentConfigId, {
context: req.body.context,
question: req.body.question,
index: req.body.index,
input: req.body.dsl,
topNLogPatternData: req.body.topNLogPatternData,
});
let summary;
let insightAgentIdExists = false;
Expand Down

0 comments on commit 11b8412

Please sign in to comment.