Skip to content

[SigEvents] Seed sigevents env script#261172

Merged
crespocarlos merged 14 commits intoelastic:mainfrom
crespocarlos:feature/seed-sigevents-env
Apr 14, 2026
Merged

[SigEvents] Seed sigevents env script#261172
crespocarlos merged 14 commits intoelastic:mainfrom
crespocarlos:feature/seed-sigevents-env

Conversation

@crespocarlos
Copy link
Copy Markdown
Contributor

@crespocarlos crespocarlos commented Apr 3, 2026

Summary

What it seeds:

  • Logs via SynthtraceClientsManager + @kbn/synthtrace-client timerange API into the synthtrace default stream (logs-synth-default), with a 30-minute baseline window followed by a failure injection phase
  • Features (entity/service, entity/infra, dependency edges) into .kibana_streams_features-*
  • Queries (ES|QL rules) via the Streams queries API, with post-promotion rule_id resolution via a bounded poll against .kibana_streams_assets
  • Alerts (one per matching log row per query) into .alerts-streams.alerts-default, with deterministic IDs derived via UUIDv5
  • Insights via /internal/streams/_insights/_bulk
  • Task docs (features, queries, onboarding, insights) into .kibana_streams_tasks via a temporary system_indices_superuser account
    Key design points:
  • All seeded IDs are deterministic (UUIDv5) — re-running produces the same IDs, making the seed idempotent
  • --clean wipes all seeded data before re-seeding
  • Shared payload builders (buildFeaturePayloads, buildInsightPayloads) live in lib/builders.ts and are consumed by both the seed steps and the task doc assembler, keeping payloads consistent across storage paths
  • Stream name is always derived from synthtrace's own routing (getSynthtraceDefaultStream()) — no hardcoding

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

🤖 Co-authored with AI assistance.

@crespocarlos crespocarlos force-pushed the feature/seed-sigevents-env branch from 61431b3 to 0a389b2 Compare April 3, 2026 17:18
@crespocarlos crespocarlos changed the title Feature/seed sigevents env [SigEvents] Seed sigevents env script Apr 6, 2026
@crespocarlos crespocarlos marked this pull request as ready for review April 6, 2026 21:05
@crespocarlos crespocarlos requested review from a team as code owners April 6, 2026 21:05
@crespocarlos crespocarlos requested a review from ruflin April 6, 2026 21:05
@crespocarlos crespocarlos added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) Team:SigEvents Project team working on Significant Events closes:sig-events PR closes an issue labeled for Significant Events labels Apr 6, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 6, 2026

Approvability

Verdict: Needs human review

This PR introduces a substantial new development seeding tool (~1400 lines) for the sigevents environment. While it's dev-only tooling that doesn't affect production runtime, the author does not own any of the changed files - all are owned by @elastic/obs-onboarding-team and @elastic/obs-sig-events-team. The designated code owners should review this new capability.

You can customize Macroscope's approvability policy. Learn more.

@ruflin
Copy link
Copy Markdown
Contributor

ruflin commented Apr 8, 2026

Did a quick test run and this works as expected for KI and queries. It did not generated any insights / Sig events for me.

We had a quick discussion around that it would be nice, if we could also specify some specific cases we want to see / test in the UI here which is not directly the case. But my understanding is we can modify / enhance the generation at any time to also new data structures inside, all the tooling is in place.

@crespocarlos
Copy link
Copy Markdown
Contributor Author

Did a quick test run and this works as expected for KI and queries. It did not generated any insights / Sig events for me.

It should have generated insights. let me test it again

We had a quick discussion around that it would be nice, if we could also specify some specific cases we want to see / test in the UI here which is not directly the case. But my understanding is we can modify / enhance the generation at any time to also new data structures inside, all the tooling is in place.

what specific cases would that be?

taskDocIds included INSIGHTS_TASK_TYPE (global singleton) alongside
per-stream IDs, meaning cleanTasks would delete the global insights task
whenever any single stream was cleaned — breaking other streams if
multiple were seeded simultaneously.

Rename taskDocIds → streamTaskDocIds (per-stream only), resolve
insightsId directly from INSIGHTS_TASK_TYPE in buildTaskDocs, and
assemble the full ID list explicitly in cleanTasks with a comment
documenting the multi-stream trade-off.

Made-with: Cursor
@ruflin
Copy link
Copy Markdown
Contributor

ruflin commented Apr 8, 2026

Tested again and insights are generated now.

what specific cases would that be?

I'm thinking of cases like having on Significant Events with a too long title, missing fields etc. All the fun that LLMs generate from time to time should not break the UI.

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@ruflin
Copy link
Copy Markdown
Contributor

ruflin commented Apr 10, 2026

Tested again and works as expected. We can add more and other data entries over time.

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

merge conflict between base and head

@crespocarlos
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

There are no new commits on the base branch.

Comment thread x-pack/platform/plugins/shared/streams/tsconfig.json
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@crespocarlos crespocarlos merged commit d5886ed into elastic:main Apr 14, 2026
21 checks passed
@crespocarlos crespocarlos deleted the feature/seed-sigevents-env branch April 14, 2026 14:24
mbondyra added a commit to mbondyra/kibana that referenced this pull request Apr 14, 2026
* commit '11ed3645c5ededae2a6e29f2a79b31f52208b441': (157 commits)
  remove sync register uiAction methods (elastic#254590)
  [performance] Apply minimal auth to the search route (elastic#257497)
  [ES|QL] Reports correctly the controls server side errors (elastic#263020)
  [SecuritySolution][Navigation] Enable classic nav updates (elastic#262358)
  [Inference] Use pretty name and logo on feature settings page (elastic#262531)
  [Security Solution] fix AT-AB cypress test (elastic#262991)
  [SigEvents] Seed sigevents env script (elastic#261172)
  Adjust conditions for validating no refetch for expanded row (elastic#262978)
  [Agent Builder] update copy for the announcement modal (elastic#263034)
  [Search] Hide index management links for users without privileges (elastic#262627)
  Simplify OAS schema for GET `/api/spaces/space` query params (elastic#260831)
  Fix fleet output OAS regressions: SSL type explosion and Kafka union wrappers (elastic#260842)
  [Dashboards in chat] fix agent confusing the axes in a horizontal chat (elastic#263064)
  [One Workflow] Add alert state checkbox UI for workflow connector (elastic#259770)
  [One Workflow] Deprecate legacy Cases step types in workflow authoring (elastic#262070)
  skip failing test suite (elastic#248090)
  fix flaky test: MonitorDetails filter apply button not enabled (elastic#260788)
  fix: propagate AbortSignal to executeAsReasoningAgent for task cancellation (elastic#262811)
  [Security Solution][Alert KPI] Fix white space bug in alert KPIs (elastic#260803)
  [Streams] Move helpers and format_size_unit to utils folder (elastic#262550)
  ...

# Conflicts:
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/dashboard_canvas_content.test.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/dashboard_canvas_content.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/canvas_integration/use_register_canvas_action_buttons.ts
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/index.test.tsx
#	x-pack/platform/plugins/shared/dashboard_agent/public/attachment_types/index.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting closes:sig-events PR closes an issue labeled for Significant Events Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) release_note:skip Skip the PR/issue when compiling release notes Team:SigEvents Project team working on Significant Events v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants