[Automatic Migrations] Dashboard migration agent initial Implementation#232637
[Automatic Migrations] Dashboard migration agent initial Implementation#232637logeekal wants to merge 61 commits intoelastic:mainfrom
Conversation
data service changes filter queries dsl queries agent tools extracted dashboards agent graph initial implementation graph executing fix selectIndexPatterns
❗ Move to Inference ModelAs mentioned in this PR : #206710, we no longer need to use per-provider based model and can simply use |
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
There was a problem hiding this comment.
Great work @semd . Still not done with full code review but will resume after today's meetings. After going through the trace you shared. I have some comments and questions.
- Regarding Empty panel : https://github.com/elastic/kibana/pull/232637/files#r2318624696
Why do we need Panel descriptions and panel dashboards in the index?Please ignore. I misunderstood. they are only part of graph.And if we do, we can put them in the index when we import it so that we do not have to parse again.- In this particular
translatePanelnode, theindexPatternis.*, which fails in the dashboard i have linked in the one of the comments below. May be we should specially check it and replace it withplaceholder. - If a panel is
untranslatable, I think we should add comments paired withtitleof the panel and why it was untranslatable, similar to Rules.
We can ofcourse discuss these points in the Eng. sync.
...ty_solution/server/lib/siem_migrations/common/task/agent/helpers/inline_spl_query/prompts.ts
Show resolved
Hide resolved
...lution/server/lib/siem_migrations/common/task/agent/helpers/translate_spl_to_esql/prompts.ts
Show resolved
Hide resolved
...plugins/security_solution/server/lib/siem_migrations/common/task/util/actions_client_chat.ts
Show resolved
Hide resolved
...security_solution/server/lib/siem_migrations/common/task/siem_migrations_telemetry_client.ts
Show resolved
Hide resolved
...ity/plugins/security_solution/server/lib/siem_migrations/dashboards/api/dashboards/create.ts
Show resolved
Hide resolved
...r/lib/siem_migrations/dashboards/task/agent/nodes/aggregate_dashboard/aggregate_dashboard.ts
Outdated
Show resolved
Hide resolved
...r/lib/siem_migrations/dashboards/task/agent/nodes/aggregate_dashboard/aggregate_dashboard.ts
Show resolved
Hide resolved
...r/lib/siem_migrations/dashboards/task/agent/nodes/aggregate_dashboard/aggregate_dashboard.ts
Outdated
Show resolved
Hide resolved
...r/lib/siem_migrations/dashboards/task/agent/nodes/create_descriptions/create_descriptions.ts
Show resolved
Hide resolved
...r/lib/siem_migrations/dashboards/task/agent/nodes/aggregate_dashboard/aggregate_dashboard.ts
Show resolved
Hide resolved
…gration_dashboard_agent' into feat/automatic_migration_dashboard_agent
logeekal
left a comment
There was a problem hiding this comment.
Overall code is looking great ✨ . All are minor comments.. Doing some desk testing and will get back.
...s/dashboards/task/agent/sub_graphs/translate_panel/nodes/translation_result/process_panel.ts
Outdated
Show resolved
Hide resolved
...s/dashboards/task/agent/sub_graphs/translate_panel/nodes/translation_result/process_panel.ts
Outdated
Show resolved
Hide resolved
...s/dashboards/task/agent/sub_graphs/translate_panel/nodes/translation_result/process_panel.ts
Outdated
Show resolved
Hide resolved
...s/dashboards/task/agent/sub_graphs/translate_panel/nodes/translation_result/process_panel.ts
Show resolved
Hide resolved
...hboards/task/agent/sub_graphs/translate_panel/nodes/translation_result/translation_result.ts
Outdated
Show resolved
Hide resolved
...on/server/lib/siem_migrations/dashboards/task/agent/nodes/translate_panel/translate_panel.ts
Show resolved
Hide resolved
...on/server/lib/siem_migrations/dashboards/task/agent/nodes/translate_panel/translate_panel.ts
Show resolved
Hide resolved
...y_solution/server/lib/siem_migrations/dashboards/task/dashboard_migrations_task_evaluator.ts
Show resolved
Hide resolved
...solution/server/lib/siem_migrations/dashboards/task/dashboard_migrations_telemetry_client.ts
Show resolved
Hide resolved
...on/server/lib/siem_migrations/dashboards/task/agent/nodes/translate_panel/translate_panel.ts
Show resolved
Hide resolved
| const parser = new SplunkXmlDashboardParser(state.original_dashboard.data); | ||
| const panels = await parser.extractPanels(); |
There was a problem hiding this comment.
Current method works but SplunkXmlDashboardParser has a static method called isSupportedSplunkXml which does a quick regex check without parsing if the dashboard is even support and returns a relevant error.
I think it could be useful to do a quick check before even spending time in parsing and we could even return the relevant error. See if that is of any use.
There was a problem hiding this comment.
|
@semd , I found only one issue which i think should be fixed before this PR is merged. Here the dashboard description generation is failing because there are no panels. I think we should have a node like May be there should be a node which will check panels existence and if not, will simply skip the complete graph based on the conditional check with correct properties such as Otherwise fields such as |
@logeekal fixed here: 171664f Example (evaluation) trace: https://smith.langchain.com/public/213446e7-9819-43c8-a4db-02c20ee3bf2f/r |
|
Appreciate the feedback, @logeekal. |
💔 Build Failed
Failed CI StepsHistory
cc @semd |
Summary
Initial implementation of the dashboard translation agent.
Dashboard migration graph
indexPatternselection node implemented using AI Assistant subgraphAdditional changes
InferenceChatModel.About Rules migrations
This PR moves some logic from the rule migration agent to shared agent helpers, to be used by the dashboard migration agent as well.
At the same time, these node helpers (
validate_esql,tranlsate_spl_to_esql,inline_spl_query,fix_esql_errors...) have been improved and some bugs have been fixed, as mentioned above.Hence, this PR not only introduces the dashboard migration agent but also impacts the rules translations, which will receive improvements for free. However, we'll also need to test rule migrations and ensure no regression has been introduced.
Dashboard migration graph
translatePanelsub-graph is executed on a per-panel basis, concurrently.aggregateDashboardnode to create the elastic dashboard JSON.Example Trace
https://smith.langchain.com/public/ace2e897-84d8-4cec-8a35-53177816a4a1/r