Skip to content

Commit

Permalink
package datastreams support rules
Browse files Browse the repository at this point in the history
  • Loading branch information
klacabane committed Aug 6, 2022
1 parent 879122d commit 536c537
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const KibanaInstance = ({ data, alerts }: { data: any; alerts: any }) => {
const showRules =
data.metrics.kibana_instance_rule_executions &&
data.metrics.kibana_instance_rule_executions.length &&
data.metrics.kibana_instance_rule_executions[0].indices_found.metricbeat;
data.metrics.kibana_instance_rule_executions[0].indices_found.ecs;

return (
<EuiPage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const KibanaOverview = ({ data }: { data: any }) => {
const showRules =
data.metrics.kibana_cluster_rule_overdue_count &&
data.metrics.kibana_cluster_rule_overdue_count.length &&
data.metrics.kibana_cluster_rule_overdue_count[0].indices_found.metricbeat;
data.metrics.kibana_cluster_rule_overdue_count[0].indices_found.ecs;

return (
<EuiPage>
Expand Down
12 changes: 8 additions & 4 deletions x-pack/plugins/monitoring/server/lib/details/get_series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
INDEX_PATTERN_TYPES,
STANDALONE_CLUSTER_CLUSTER_UUID,
METRICBEAT_INDEX_NAME_UNIQUE_TOKEN,
DS_INDEX_PATTERN_METRICS,
} from '../../../common/constants';
import { formatUTCTimestampForTimezone } from '../format_timezone';
import { getNewIndexPatterns } from '../cluster/get_index_patterns';
Expand Down Expand Up @@ -291,7 +292,7 @@ function handleSeries(
bucketSizeInSeconds * 1000
);
let internalIndicesFound = false;
let mbIndicesFound = false;
let ecsIndicesFound = false;
let data: Array<[string | number, number | null]> = [];

if (firstUsableBucketIndex <= lastUsableBucketIndex) {
Expand All @@ -308,8 +309,11 @@ function handleSeries(
// map buckets to X/Y coords for Flot charting
if (bucket.indices) {
for (const indexBucket of bucket.indices.buckets) {
if (indexBucket.key.includes(METRICBEAT_INDEX_NAME_UNIQUE_TOKEN)) {
mbIndicesFound = true;
if (
indexBucket.key.includes(METRICBEAT_INDEX_NAME_UNIQUE_TOKEN) ||
indexBucket.key.includes(DS_INDEX_PATTERN_METRICS)
) {
ecsIndicesFound = true;
} else {
internalIndicesFound = true;
}
Expand All @@ -327,7 +331,7 @@ function handleSeries(
? {
indices_found: {
internal: internalIndicesFound,
metricbeat: mbIndicesFound,
ecs: ecsIndicesFound,
},
}
: {};
Expand Down

0 comments on commit 536c537

Please sign in to comment.