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

[SLO Form] Use saved Data view id , handle runtime mappings #176662

Merged
merged 61 commits into from
Jun 7, 2024

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Feb 12, 2024

Summary

Fixes #173771

Use saved data view id instead of index pattern where it's available.
Inject runtime mappings from the dataview into transform.

  • Go to Discover and add a runtime field to the data view (this is only available in Discover)
  • Make sure filtering works based on the data view

We are not supporting "scripted fields" from the Index Management DataView editor.

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@shahzad31 shahzad31 marked this pull request as ready for review February 21, 2024 12:52
@shahzad31 shahzad31 requested a review from a team as a code owner February 21, 2024 12:52
@shahzad31 shahzad31 changed the title [SLO Form] Use Data view id [SLO Form] Use saved Data view id , handle runtime mappings Feb 21, 2024
@shahzad31 shahzad31 added the release_note:skip Skip the PR/issue when compiling release notes label Feb 21, 2024
@kdelemme kdelemme self-requested a review February 21, 2024 13:09
Copy link
Contributor

@kdelemme kdelemme left a comment

Choose a reason for hiding this comment

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

Overall that's a good idea that we had also with Chris a while back.

But I'm a bit concerned with including all runtime fields every time they exists when we create a transform with a DataView. I think we can do two things to reduce the risk on performance:

  1. Add the runtime fields when the user specifically asks for it
  2. Add only the runtime fields that are necessary for the different queries

The second option is obviously harder and more cumbersome in terms of surface API that need to changed, but would not require the first option at all.
The first option gives us at least a safety switch, and moves any performance issue into the customer hands, and is very easy to implement.

So if we move forward with this, I'd request for at least the settings option to be included as well (slo.settings can be used).

What do you think?

@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Feb 21, 2024
@elasticmachine
Copy link
Contributor

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

@shahzad31
Copy link
Contributor Author

@kdelemme i have addressed the rest of the comments, let me know if we need further discussion regarding run time mappings

@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

@kdelemme kdelemme dismissed their stale review March 5, 2024 23:24

I won't have time to test it locally, but code change LGTM. Chris to take over

@shahzad31
Copy link
Contributor Author

added a callout
image

@simianhacker
Copy link
Member

It looks like the only indicator that works with a "scripted field" is KQL. They are not showing up in the filters for any of the other indicators. I was also expecting to be able to use them as a field for a "Timeslice Metric" and "Custom Metric" which it doesn't seem to appear in the field drop down.

For reference, I created a scripted field on the "Message Processor" data view from fake_stack called processor.failed with the source doc['processor.accepted'].value - doc['processor.processed'].value. I doubled checked that this field is aggregatable in Lens.

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label May 7, 2024
@shahzad31 shahzad31 marked this pull request as draft May 21, 2024 10:05
@shahzad31 shahzad31 marked this pull request as ready for review June 5, 2024 14:27
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 6, 2024

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
slo 847 850 +3

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
slo 64 65 +1

Async chunks

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

id before after diff
slo 858.2KB 860.4KB +2.2KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5499 +5499
total size - 8.9MB +8.9MB

Page load bundle

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

id before after diff
observability 122.7KB 122.8KB +147.0B
Unknown metric groups

API count

id before after diff
slo 64 65 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream


const { isLoading: isDataViewsLoading, data: dataViews = [], refetch } = useFetchDataViews();

const { dataViewEditor } = useKibana().services;

const { dataViewEditor } = useKibana<SloPublicPluginsStart>().services;
Copy link
Contributor

Choose a reason for hiding this comment

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

merge with above useKibana()

@kdelemme
Copy link
Contributor

kdelemme commented Jun 6, 2024

Users will need to harden their runtime mappings when used in an SLO otherwise the transform won't start:

For example:

if (doc["http.request.bytes"].size()==0) {
    emit(false);
    return;
} 

emit(doc["http.request.bytes"].value < 600)

@shahzad31 shahzad31 merged commit f3fdb0f into elastic:main Jun 7, 2024
20 checks passed
@shahzad31 shahzad31 deleted the form-use-data-view-id branch June 7, 2024 12:17
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Jun 7, 2024
@lcawl lcawl mentioned this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Support scripted/runtime fields for DataViews
8 participants