Skip to content

Conversation

@kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Jul 8, 2025

Summary

Resolves #214436

Mostly copied over from https://github.com/elastic/kibana/pull/216150/files#diff-51505aa38745af6aa946a2f13b7319659ead2bda2c9d2effc5e061bc88f15b69

This PR adds a /significant_events/_generate API that returns generated significant event definitions based on the current streams data.
The current algorithm works as follow:

  1. Fetch 24 hours of sampled data from the stream name index
  2. Select either "message" or "body.text" as field to run log patterns analysis upon
  3. Run log patterns analysis for the past 7 days on the selected field to find recurring patterns
  4. Ask the LLM to generate significant events queries based on this recurrent patterns
  5. Validate the generated queries by looking for document count in the past 7 days
  6. Ask the LLM to select the queries it thinks are the most important

In this PR we also integrate with the LLM eval runner framework: example

Prompts

initial
followup

Manual testing

  1. Enable streams: POST kbn:/api/streams/_enable
  2. Enable Significant Events advanced settings UI
  3. Run logs generator: node scripts/synthtrace.js sample_logs --live --kibana=http://elastic:changeme@localhost:5601 --target=http://elastic:changeme@localhost:9200 --liveBucketSize=1000
  4. Configure a llm connector: https://ela.st/o11y-ai-openai-credentials
  5. Call the generate significant events API:
    curl --request GET \
      --url 'http://localhost:5601/api/streams/logs/significant_events/_generate?connectorId=azure-gpt4o' \
      --header 'Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==' \
      --header 'Content-Type: multipart/form-data' \
      --header 'kbn-xsrf: oui'
    
  6. (optional) Configure phoenix so you can see the llm prompts

LLM-based testing

  1. Start scout:
node scripts/scout.js start-server --stateful
  1. Run the tests:
node scripts/playwright test --config x-pack/platform/packages/private/kbn-evals-suite-streams/playwright.config.ts

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Jul 8, 2025
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --update'
…urce-definitions/scripts/fix-location-collection.ts'
@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. backport:version Backport to applied version labels v9.2.0 labels Jul 8, 2025
@kdelemme kdelemme self-assigned this Jul 8, 2025
@kdelemme kdelemme marked this pull request as ready for review July 9, 2025 14:58
@kdelemme kdelemme removed the request for review from lukasolson August 4, 2025 18:00
@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

History

cc @kdelemme

@kdelemme kdelemme force-pushed the streams/sig-events-suggestion branch from c12217d to 3156242 Compare August 4, 2025 18:45
@kdelemme kdelemme merged commit 0c13652 into elastic:main Aug 4, 2025
18 checks passed
@kdelemme kdelemme deleted the streams/sig-events-suggestion branch August 4, 2025 19:36
szaffarano pushed a commit to szaffarano/kibana that referenced this pull request Aug 5, 2025
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 6, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

7 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

6 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 227126 locally
cc: @kdelemme

@maryam-saeidi maryam-saeidi added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Aug 27, 2025
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Streams] Generate significant event queries with LLM

10 participants