-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Observability] Related alerts based on scoring !! #215673
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
Changes from 14 commits
afffcdb
9c364ec
7f6b28a
76e89e4
835fb7a
3fa36d1
397c40a
c36cc91
43d9cf8
55366c2
791786a
db8c604
d581f06
f27c5d2
a7763a1
b478b59
ab3c789
ba24dd7
bcd3383
0890214
afedc39
b20da11
4690950
a211f95
626923e
de7946d
ea56aca
4f36da8
a0c45c6
1c3de19
a647a90
a559fc1
4ad695c
d303220
fa11357
c447232
32ec62b
5103880
1723ed3
831b9e7
d341b70
f27601b
ea688d6
e0f6dab
22c4f92
e53e193
0641f85
0a427a2
eb1a31e
aecab6b
75b403c
624623c
14cc8a0
5bc4667
0e98a91
b6f1c86
3e795d0
001a597
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,7 @@ import { JsonValue } from '@kbn/utility-types'; | |||||
| export interface MetaAlertFields { | ||||||
| _id: string; | ||||||
| _index: string; | ||||||
| _score?: string | JsonValue[]; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To type this correctly as a diff --git a/src/platform/packages/shared/kbn-alerting-types/alerts_types.ts b/src/platform/packages/shared/kbn-alerting-types/alerts_types.ts
index 24230a96336..f519e842cb9 100644
--- a/src/platform/packages/shared/kbn-alerting-types/alerts_types.ts
+++ b/src/platform/packages/shared/kbn-alerting-types/alerts_types.ts
@@ -30,7 +30,7 @@ export type KnownAlertFields = {
[Property in TechnicalRuleDataFieldName]?: JsonValue[];
};
-export type UnknownAlertFields = Record<string, string | JsonValue[]>;
+export type UnknownAlertFields = Record<string, string | number | JsonValue[]>;
/**
* Alert document type as returned by alerts search requests
diff --git a/src/platform/packages/shared/response-ops/alerts-table/components/default_alerts_flyout.tsx b/src/platform/packages/shared/response-ops/alerts-table/components/default_alerts_flyout.tsx
index 77c3cc66733..a055869b82a 100644
--- a/src/platform/packages/shared/response-ops/alerts-table/components/default_alerts_flyout.tsx
+++ b/src/platform/packages/shared/response-ops/alerts-table/components/default_alerts_flyout.tsx
@@ -12,6 +12,7 @@ import { EuiDescriptionList, EuiPanel, EuiTabbedContentTab, EuiTitle } from '@el
import { ALERT_RULE_NAME } from '@kbn/rule-data-utils';
import { i18n } from '@kbn/i18n';
import { ScrollableFlyoutTabbedContent, AlertFieldsTable } from '@kbn/alerts-ui-shared';
+import { JsonValue } from '@kbn/utility-types';
import { AdditionalContext, FlyoutSectionProps } from '../types';
import { defaultAlertsTableColumns } from '../configuration';
import { DefaultCellValue } from './default_cell_value';
@@ -43,7 +44,7 @@ export const DefaultAlertsFlyoutBody = <AC extends AdditionalContext>(
<EuiPanel hasShadow={false} data-test-subj="overviewTabPanel">
<EuiDescriptionList
listItems={(columns ?? defaultAlertsTableColumns).map((column) => {
- const value = alert[column.id]?.[0];
+ const value = (alert[column.id] as JsonValue[])?.[0];
return {
title: (column.displayAsText as string) ?? column.id,
diff --git a/src/platform/packages/shared/response-ops/alerts-table/components/default_cell_value.tsx b/src/platform/packages/shared/response-ops/alerts-table/components/default_cell_value.tsx
index 97bcdc88a8a..8cfeba5c63c 100644
--- a/src/platform/packages/shared/response-ops/alerts-table/components/default_cell_value.tsx
+++ b/src/platform/packages/shared/response-ops/alerts-table/components/default_cell_value.tsx
@@ -94,7 +94,7 @@ export const DefaultCellValue = ({
/**
* Extracts the value from the raw json ES field
*/
-const extractFieldValue = (rawValue: string | JsonValue[]) => {
+const extractFieldValue = (rawValue: string | number | JsonValue[]) => {
const value = Array.isArray(rawValue) ? rawValue.join() : rawValue;
if (!isEmpty(value)) {
diff --git a/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_value.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_value.tsx
index 9ac39f42aeb..724bde5cc11 100644
--- a/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_value.tsx
+++ b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_value.tsx
@@ -26,6 +26,7 @@ import {
} from '@kbn/rule-data-utils';
import { isEmpty } from 'lodash';
import type { Alert } from '@kbn/alerting-types';
+import type { JsonValue } from '@kbn/utility-types';
import {
RELATED_ACTIONS_COL,
RELATED_ALERT_REASON,
@@ -44,7 +45,7 @@ import AlertActions from '../../alert_actions/alert_actions';
export const getAlertFieldValue = (alert: Alert, fieldName: string) => {
// can be updated when working on https://github.com/elastic/kibana/issues/140819
- const rawValue = alert[fieldName];
+ const rawValue = alert[fieldName] as JsonValue[];
const value = Array.isArray(rawValue) ? rawValue.join() : rawValue;
if (!isEmpty(value)) {
|
||||||
| } | ||||||
|
|
||||||
| export interface LegacyField { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,4 +72,4 @@ | |
| "common" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.