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

[Logs UI] Index reason in log threshold executor #106291

Merged
merged 6 commits into from
Jul 22, 2021

Conversation

weltenwort
Copy link
Member

📝 Summary

This adds the <alerts-namespace>.reason (where <alerts-namespace> is incorrect at the moment, see #102089) to the "technical" mappings. It also updates the log threshold executor to index the reason as part of the lifecycle and changes the browser-side formatter to pass through that indexed reason.

closes #105785

🎨 Previews

image

🕵️ Review notes

  • The reason field uses the shared prefix defined in a technical field constant, which incorrectly contains kibana.rac.alert right now. This will be fixed separately.
  • After startup the alerts index should not contain the serialized log threshold rule params anymore, since they are no longer needed to construct the reason in the browser.

@weltenwort weltenwort added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed Theme: rac label obsolete Feature:RAC label obsolete v7.15.0 Feature:Observability RAC labels Jul 20, 2021
@weltenwort weltenwort self-assigned this Jul 20, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 887 884 -3

Async chunks

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

id before after diff
apm 4.3MB 4.3MB +353.0B
observability 460.5KB 460.9KB +421.0B
total +774.0B

Page load bundle

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

id before after diff
apm 40.3KB 40.4KB +68.0B
infra 147.3KB 145.0KB -2.3KB
total -2.3KB

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

cc @weltenwort

@weltenwort weltenwort marked this pull request as ready for review July 20, 2021 20:46
@weltenwort weltenwort requested a review from a team as a code owner July 20, 2021 20:46
@Kerry350 Kerry350 self-requested a review July 22, 2021 09:20
const alertInstance = alertInstanceFactory(
group.name,
getReasonMessageForGroupedCountAlert(
documentCount,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a simple comment nothing really wrong about that. getReasonMessageForGroupedCountAlert accepts as first parameter the actual value and second parameter the expected value. The alertInstanceFactory accepts first the expected value and then the actual value. Maybe a symmetry in the order of parameters between the two functions would makes sense? I just had to ensure that arguments were passed the correct way because they were the other way around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point - I'll change the order of arguments.

Copy link
Member Author

@weltenwort weltenwort Jul 22, 2021

Choose a reason for hiding this comment

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

ℹ️ I merged without it to unblock dependent PRs. I'll create a separate PR for the improvement: #106532

const { field, comparator, value } = criterion;
return `${field} ${comparator} ${value}`;
})
.join(' and ');
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall this be internationalized?

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't change the content here, just fixed it to avoid superfluous leading whitespace.

@mgiota
Copy link
Contributor

mgiota commented Jul 22, 2021

LGTM!

@Kerry350 Kerry350 removed their request for review July 22, 2021 09:33
@weltenwort weltenwort merged commit 1a7469f into elastic:master Jul 22, 2021
@weltenwort weltenwort deleted the rac-index-alert-reason branch July 22, 2021 13:06
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 22, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Observability RAC Feature:RAC label obsolete release_note:skip Skip the PR/issue when compiling release notes Theme: rac label obsolete v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAC] Formatted reason per alert should be stored in alert document
3 participants