Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discover] Add selector syntax support to log source profile #206937

Merged

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented Jan 16, 2025

📝 Summary

This adds support for the new selector syntax to the log source profile heuristics. It will only match when index name expression exclusively contains implicit or explicit data selectors.

🎨 Previews

image

image

image

🕵️‍♀️ How to test

Enable the failure store on logs indices:

PUT _component_template/logs@custom
{
  "template": {
    "data_stream_options": {
      "failure_store": {
        "enabled": true
      }
    }
  }
}

Then ingest some failing log documents using synthtrace:

kbn-synthtrace --live failed_logs.ts

Create data views with various selectors an "Observability" space to see the effect.

Due to limitations in the ES|QL parser this can't be tested in ES|QL mode right now, even though the change should already apply there as well.

@weltenwort weltenwort added the Team:obs-ux-logs Observability Logs User Experience Team label Jan 16, 2025
@weltenwort weltenwort self-assigned this Jan 16, 2025
@weltenwort weltenwort added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:enhancement labels Jan 16, 2025
@weltenwort weltenwort marked this pull request as ready for review January 16, 2025 15:35
@weltenwort weltenwort requested review from a team as code owners January 16, 2025 15:35
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice update and great refactor of the createRegExpPatternFrom utility 👏

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes LGTM and it works well! Thanks for addressing it.

@weltenwort
Copy link
Member Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/data-view-utils 5 6 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 844.0KB 844.2KB +166.0B
logsExplorer 222.5KB 222.5KB -2.0B
total +164.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
logsExplorer 26.5KB 26.7KB +164.0B
Unknown metric groups

API count

id before after diff
@kbn/data-view-utils 7 8 +1

History

cc @weltenwort

@weltenwort weltenwort merged commit 032c481 into elastic:main Jan 20, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

/~https://github.com/elastic/kibana/actions/runs/12868406785

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 20, 2025
…#206937)

This adds support for the new selector syntax to the log source profile
heuristics. It will only match when index name expression exclusively
contains implicit or explicit `data` selectors.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 032c481)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 20, 2025
…206937) (#207190)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] Add selector syntax support to log source profile
(#206937)](#206937)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](/~https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Felix
Stürmer","email":"weltenwort@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-01-20T12:50:32Z","message":"[Discover]
Add selector syntax support to log source profile (#206937)\n\nThis adds
support for the new selector syntax to the log source
profile\r\nheuristics. It will only match when index name expression
exclusively\r\ncontains implicit or explicit `data`
selectors.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"032c481ec17e5b4bed83830a34a5c00834ec7116","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Team:obs-ux-logs"],"title":"[Discover]
Add selector syntax support to log source
profile","number":206937,"url":"/~https://github.com/elastic/kibana/pull/206937","mergeCommit":{"message":"[Discover]
Add selector syntax support to log source profile (#206937)\n\nThis adds
support for the new selector syntax to the log source
profile\r\nheuristics. It will only match when index name expression
exclusively\r\ncontains implicit or explicit `data`
selectors.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"032c481ec17e5b4bed83830a34a5c00834ec7116"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"/~https://github.com/elastic/kibana/pull/206937","number":206937,"mergeCommit":{"message":"[Discover]
Add selector syntax support to log source profile (#206937)\n\nThis adds
support for the new selector syntax to the log source
profile\r\nheuristics. It will only match when index name expression
exclusively\r\ncontains implicit or explicit `data`
selectors.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"032c481ec17e5b4bed83830a34a5c00834ec7116"}}]}]
BACKPORT-->

Co-authored-by: Felix Stürmer <weltenwort@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:enhancement Team:obs-ux-logs Observability Logs User Experience Team v8.18.0 v9.0.0
Projects
None yet
5 participants