[Stack Monitoring] Remove ts-ignore annotation (#145759)

## Summary

Closes #144289

This PR just removes ts-ignore annotation where it's not needed anymore.

### How to test

- Start local Kibana
- Go to stack monitoring and try to access all the pages there.

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Carlos Crespo 2022-11-30 10:52:27 +01:00 committed by GitHub
parent 217a04078d
commit f7b846467f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 0 additions and 80 deletions

View file

@ -4,6 +4,5 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
// @ts-ignore
export { formatTimestampToDuration } from './format_timestamp_to_duration';

View file

@ -14,7 +14,6 @@ import {
AlertMessageLinkToken,
AlertMessageDocLinkToken,
} from '../../../common/types/alerts';
// @ts-ignore
import { formatTimestampToDuration } from '../../../common';
import { CALCULATE_DURATION_UNTIL } from '../../../common/constants';
import { AlertMessageTokenType } from '../../../common/enums';

View file

@ -10,7 +10,6 @@ import { find } from 'lodash';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { ElasticsearchTemplate } from './elasticsearch_template';
import { GlobalStateContext } from '../../contexts/global_state_context';
// @ts-ignore
import { ElasticsearchOverview } from '../../../components/elasticsearch';
import { ComponentProps } from '../../route_init';
import { useCharts } from '../../hooks/use_charts';

View file

@ -20,7 +20,6 @@ import {
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { GlobalStateContext } from '../../contexts/global_state_context';
import { ComponentProps } from '../../route_init';
// @ts-ignore
import { LogstashTemplate } from './logstash_template';
// @ts-ignore
import { DetailStatus } from '../../../components/logstash/detail_status';

View file

@ -9,7 +9,6 @@ import React, { useCallback, useContext, useState } from 'react';
import { Redirect } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
// @ts-ignore
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { NoData } from '../../../components/no_data';
import { PageTemplate } from '../page_template';

View file

@ -26,7 +26,6 @@ import {
CommonAlertFilter,
} from '../../common/types/alerts';
import { RULE_CPU_USAGE, RULE_DETAILS } from '../../common/constants';
// @ts-ignore
import { ROUNDED_FLOAT } from '../../common/formatting';
import { fetchCpuUsageNodeStats } from '../lib/alerts/fetch_cpu_usage_node_stats';
import { AlertMessageTokenType, AlertSeverity } from '../../common/enums';

View file

@ -25,7 +25,6 @@ import {
CommonAlertFilter,
} from '../../common/types/alerts';
import { RULE_DISK_USAGE, RULE_DETAILS } from '../../common/constants';
// @ts-ignore
import { ROUNDED_FLOAT } from '../../common/formatting';
import { fetchDiskUsageNodeStats } from '../lib/alerts/fetch_disk_usage_node_stats';
import { AlertMessageTokenType, AlertSeverity } from '../../common/enums';

View file

@ -121,7 +121,6 @@ describe('ElasticsearchVersionMismatchAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -175,7 +174,6 @@ describe('ElasticsearchVersionMismatchAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).not.toHaveBeenCalledWith({});

View file

@ -203,7 +203,6 @@ describe('LicenseExpirationRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).not.toHaveBeenCalledWith({});
@ -225,7 +224,6 @@ describe('LicenseExpirationRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState.mock.calls[0][0].alertStates[0].ui.severity).toBe(AlertSeverity.Danger);
@ -246,7 +244,6 @@ describe('LicenseExpirationRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState.mock.calls[0][0].alertStates[0].ui.severity).toBe(AlertSeverity.Warning);

View file

@ -122,7 +122,6 @@ describe('LogstashVersionMismatchRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -176,7 +175,6 @@ describe('LogstashVersionMismatchRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).not.toHaveBeenCalledWith({});

View file

@ -26,7 +26,6 @@ import {
CommonAlertFilter,
} from '../../common/types/alerts';
import { RULE_MEMORY_USAGE, RULE_DETAILS } from '../../common/constants';
// @ts-ignore
import { ROUNDED_FLOAT } from '../../common/formatting';
import { fetchMemoryUsageNodeStats } from '../lib/alerts/fetch_memory_usage_node_stats';
import { AlertMessageTokenType, AlertSeverity } from '../../common/enums';

View file

@ -206,7 +206,6 @@ describe('MissingMonitoringDataRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -229,7 +228,6 @@ describe('MissingMonitoringDataRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
const count = 1;

View file

@ -167,7 +167,6 @@ describe('NodesChangedAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -230,7 +229,6 @@ describe('NodesChangedAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -323,7 +321,6 @@ describe('NodesChangedAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).not.toHaveBeenCalledWith({});

View file

@ -256,7 +256,6 @@ describe('ThreadpoolSearchRejectionsRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -279,7 +278,6 @@ describe('ThreadpoolSearchRejectionsRule', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
const count = 1;

View file

@ -256,7 +256,6 @@ describe('ThreadpoolWriteRejectionsAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
expect(replaceState).toHaveBeenCalledWith({
@ -279,7 +278,6 @@ describe('ThreadpoolWriteRejectionsAlert', () => {
const type = rule.getRuleType();
await type.executor({
...executorOptions,
// @ts-ignore
params: rule.ruleOptions.defaultParams,
} as any);
const count = 1;

View file

@ -6,5 +6,4 @@
*/
export { sendBulkPayload } from './send_bulk_payload';
// @ts-ignore
export { monitoringBulk } from './monitoring_bulk';

View file

@ -6,13 +6,9 @@
*/
import { upperFirst } from 'lodash';
// @ts-ignore
import { checkParam } from '../error_missing_required';
// @ts-ignore
import { createQuery } from '../create_query';
// @ts-ignore
import { getDiffCalculation } from '../beats/_beats_stats';
// @ts-ignore
import { ApmMetric } from '../metrics';
import { getTimeOfLastEvent } from './_get_time_of_last_event';
import { LegacyRequest } from '../../types';

View file

@ -7,13 +7,9 @@
import moment from 'moment';
import { upperFirst } from 'lodash';
// @ts-ignore
import { checkParam } from '../error_missing_required';
// @ts-ignore
import { createApmQuery } from './create_apm_query';
// @ts-ignore
import { calculateRate } from '../calculate_rate';
// @ts-ignore
import { getDiffCalculation } from './_apm_stats';
import { LegacyRequest } from '../../types';
import { ElasticsearchResponse, ElasticsearchResponseHit } from '../../../common/types/es';

View file

@ -8,11 +8,8 @@
import { upperFirst } from 'lodash';
import { LegacyRequest } from '../../types';
import { ElasticsearchResponse } from '../../../common/types/es';
// @ts-ignore
import { checkParam } from '../error_missing_required';
// @ts-ignore
import { createBeatsQuery } from './create_beats_query';
// @ts-ignore
import { getDiffCalculation } from './_beats_stats';
export function handleResponse(response: ElasticsearchResponse, beatUuid: string) {

View file

@ -7,13 +7,9 @@
import moment from 'moment';
import { upperFirst } from 'lodash';
// @ts-ignore
import { checkParam } from '../error_missing_required';
// @ts-ignore
import { createBeatsQuery } from './create_beats_query';
// @ts-ignore
import { calculateRate } from '../calculate_rate';
// @ts-ignore
import { getDiffCalculation } from './_beats_stats';
import { LegacyRequest } from '../../types';
import { ElasticsearchResponse } from '../../../common/types/es';

View file

@ -5,9 +5,7 @@
* 2.0.
*/
// @ts-ignore
import { createQuery } from '../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../metrics';
import { ElasticsearchResponse } from '../../../common/types/es';
import { LegacyRequest } from '../../types';

View file

@ -5,11 +5,8 @@
* 2.0.
*/
// @ts-ignore
import { createQuery } from '../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../metrics';
// @ts-ignore
import { parseCrossClusterPrefix } from '../../../common/ccs_utils';
import { getClustersState } from './get_clusters_state';
import { ElasticsearchResponse, ElasticsearchModifiedSource } from '../../../common/types/es';

View file

@ -12,9 +12,7 @@ import {
ElasticsearchSourceKibanaStats,
ElasticsearchMetricbeatSource,
} from '../../../common/types/es';
// @ts-ignore
import { calculateOverallStatus } from '../calculate_overall_status';
// @ts-ignore
import { MonitoringLicenseError } from '../errors/custom_errors';
export type EnhancedClusters = ElasticsearchModifiedSource & {

View file

@ -6,9 +6,7 @@
*/
import moment from 'moment';
// @ts-ignore
import { ElasticsearchMetric } from '../metrics';
// @ts-ignore
import { createQuery } from '../create_query';
import { ElasticsearchResponse } from '../../../common/types/es';
import { LegacyRequest } from '../../types';

View file

@ -7,9 +7,7 @@
import moment from 'moment';
import _ from 'lodash';
// @ts-ignore
import { createQuery } from '../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../metrics';
import {
ElasticsearchResponse,

View file

@ -6,9 +6,7 @@
*/
import { includes } from 'lodash';
// @ts-ignore
import { createQuery } from '../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../metrics';
import { ML_SUPPORTED_LICENSES } from '../../../common/constants';
import { ElasticsearchResponse } from '../../../common/types/es';

View file

@ -7,9 +7,7 @@
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
import { ElasticsearchResponse } from '../../../../common/types/es';
import { LegacyRequest } from '../../../types';

View file

@ -7,13 +7,9 @@
import { get } from 'lodash';
import { i18n } from '@kbn/i18n';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { calculateRate } from '../../calculate_rate';
// @ts-ignore
import { getUnassignedShards } from '../shards';
import { ElasticsearchResponse } from '../../../../common/types/es';
import { LegacyRequest } from '../../../types';

View file

@ -6,15 +6,10 @@
*/
import { i18n } from '@kbn/i18n';
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
// @ts-ignore
import { getDefaultNodeFromId, isDefaultNode } from './get_default_node_from_id';
// @ts-ignore
import { calculateNodeType } from './calculate_node_type';
// @ts-ignore
import { getNodeTypeClassLabel } from './get_node_type_class_label';
import {
ElasticsearchSource,

View file

@ -7,10 +7,8 @@
import { isUndefined } from 'lodash';
import { getNodeIds } from './get_node_ids';
// @ts-ignore
import { filter } from '../../../pagination/filter';
import { sortNodes } from './sort_nodes';
// @ts-ignore
import { paginate } from '../../../pagination/paginate';
import { getMetrics } from '../../../details/get_metrics';
import { LegacyRequest } from '../../../../types';

View file

@ -6,11 +6,8 @@
*/
import { get } from 'lodash';
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
// @ts-ignore
import { calculateIndicesTotals } from './calculate_shard_stat_indices_totals';
import { LegacyRequest } from '../../../types';
import { ElasticsearchModifiedSource } from '../../../../common/types/es';

View file

@ -6,9 +6,7 @@
*/
import { get } from 'lodash';
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
import { LegacyRequest } from '../../../types';
import { ElasticsearchModifiedSource } from '../../../../common/types/es';

View file

@ -5,9 +5,7 @@
* 2.0.
*/
// @ts-ignore
import { createQuery } from '../../create_query';
// @ts-ignore
import { ElasticsearchMetric } from '../../metrics';
import { ElasticsearchResponse, ElasticsearchLegacySource } from '../../../../common/types/es';
import { LegacyRequest } from '../../../types';
@ -38,7 +36,6 @@ export function handleResponse(response: ElasticsearchResponse) {
// note: if the request is for a node, then it's enough to deduplicate without primary, but for indices it displays both
if (!uniqueShards.has(hit._id)) {
// @ts-ignore
shards.push({
index,
node,

View file

@ -5,7 +5,6 @@
* 2.0.
*/
// @ts-ignore
import { InfraPluginSetup } from '@kbn/infra-plugin/server';
import { CCS_REMOTE_PATTERN, INFRA_SOURCE_ID } from '../../../common/constants';
import { MonitoringConfig } from '../../config';

View file

@ -5,9 +5,6 @@
* 2.0.
*/
// @ts-ignore
export { hasStandaloneClusters } from './has_standalone_clusters';
// @ts-ignore
export { getStandaloneClusterDefinition } from './get_standalone_cluster_definition';
// @ts-ignore
export { standaloneClusterFilter } from './standalone_cluster_query_filter';

View file

@ -5,7 +5,6 @@
* 2.0.
*/
// @ts-ignore
import { ActionResult } from '@kbn/actions-plugin/common';
import { RuleTypeParams, SanitizedRule } from '@kbn/alerting-plugin/common';
import { ALERT_ACTION_TYPE_LOG } from '../../../../../common/constants';

View file

@ -309,7 +309,6 @@ export function ccrRoute(server: MonitoringCore) {
error: readExceptions.length ? readExceptions[0].exception?.type : null,
opsSynced: get(shardBucket, 'ops_synced.value'),
syncLagTime:
// @ts-ignore
fullLegacyStat?.ccr_stats?.time_since_last_read_millis ??
fullMbStat?.elasticsearch?.ccr?.follower?.time_since_last_read?.ms,
syncLagOps: get(shardBucket, 'lag_ops.value'),