Skip to content

Commit

Permalink
chore(slo): use CCS Remote index name util function (elastic#205425)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Jan 2, 2025
1 parent 50509d5 commit 4664c29
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
*/

import { SearchTotalHits } from '@elastic/elasticsearch/lib/api/types';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { ElasticsearchClient, Logger, SavedObjectsClientContract } from '@kbn/core/server';
import { isCCSRemoteIndexName } from '@kbn/es-query';
import { ALL_VALUE, Paginated, Pagination } from '@kbn/slo-schema';
import { assertNever } from '@kbn/std';
import { partition } from 'lodash';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SLO_SUMMARY_DESTINATION_INDEX_PATTERN } from '../../common/constants';
import { Groupings, SLODefinition, SLOId, StoredSLOSettings, Summary } from '../domain/models';
import { toHighPrecision } from '../utils/number';
Expand Down Expand Up @@ -225,8 +226,8 @@ function excludeStaleSummaryFilter(
}

function getRemoteClusterName(index: string) {
if (index.includes(':')) {
return index.split(':')[0];
if (isCCSRemoteIndexName(index)) {
return index.substring(0, index.indexOf(':'));
}
}

Expand Down

0 comments on commit 4664c29

Please sign in to comment.