Skip to content

Commit

Permalink
[TSVB] Remove metrics:allowCheckingForFailedShards Advanced Setting (
Browse files Browse the repository at this point in the history
…elastic#197227)

## Summary

Removes the `metrics:allowCheckingForFailedShards` and doesn't allow to
supress warnings about failed shards in TSVB.

Fixes elastic#193685

### How I tested it

1. Create a TSVB visualization that includes 2024-10-22 day in the time
picker, uses Kibana Ecommerce data view and uses a field
`day_of_week_i`. (This data is only needed if you use the same test data
in point 2)
 
<img width="1499" alt="Screenshot 2024-10-23 at 12 28 21"
src="https://github.com/user-attachments/assets/c341bf22-32d6-4ced-b42d-c4793563d827">

1. On a different tab, edit the `kibana_sample_data_ecommerce` data view
to include all the indices that start from
`kibana_sample_data_ecommerce` (so change the pattern to
`kibana_sample_data_ecommerce*`.

<img width="341" alt="Screenshot 2024-10-23 at 12 24 24"
src="https://github.com/user-attachments/assets/6b718b8b-4f0c-4a9f-ba59-c0bf36727154">

3. Add a new index with a mismatched mapping of a number field to a
string in the dev console.

```
POST /kibana_sample_data_ecommerce_2/_doc
{
  "order_date": "2024-10-22",
  "day_of_week_i": "Hello" 
}
```

Refresh the tab with TSVB visualization:

<img width="1341" alt="Screenshot 2024-10-23 at 12 27 22"
src="https://github.com/user-attachments/assets/fbba8ce0-cdb4-4e59-a53a-6c6229a50a29">
  • Loading branch information
mbondyra authored Nov 11, 2024
1 parent 99160f5 commit 6fc010c
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 42 deletions.
1 change: 0 additions & 1 deletion packages/kbn-management/settings/setting_ids/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const HISTOGRAM_BAR_TARGET_ID = 'histogram:barTarget';
export const HISTOGRAM_MAX_BARS_ID = 'histogram:maxBars';
export const HISTORY_LIMIT_ID = 'history:limit';
export const META_FIELDS_ID = 'metaFields';
export const METRICS_ALLOW_CHECKING_FOR_FAILED_SHARDS_ID = 'metrics:allowCheckingForFailedShards';
export const METRICS_ALLOW_STRING_INDICES_ID = 'metrics:allowStringIndices';
export const METRICS_MAX_BUCKETS_ID = 'metrics:max_buckets';
export const QUERY_ALLOW_LEADING_WILDCARDS_ID = 'query:allowLeadingWildcards';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,6 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'metrics:allowCheckingForFailedShards': {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'observability:apmDefaultServiceEnvironment': {
type: 'keyword',
_meta: { description: 'Default value of the setting was changed.' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export interface UsageStats {
'discover:rowHeightOption': number;
hideAnnouncements: boolean;
isDefaultIndexMigrated: boolean;
'metrics:allowCheckingForFailedShards': boolean;
'observability:syntheticsThrottlingEnabled': boolean;
'observability:enableLegacyUptimeApp': boolean;
'observability:apmLabsButton': boolean;
Expand Down
6 changes: 0 additions & 6 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -10719,12 +10719,6 @@
"description": "Non-default value of setting."
}
},
"metrics:allowCheckingForFailedShards": {
"type": "boolean",
"_meta": {
"description": "Non-default value of setting."
}
},
"observability:apmDefaultServiceEnvironment": {
"type": "keyword",
"_meta": {
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_types/timeseries/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
export const UI_SETTINGS = {
MAX_BUCKETS_SETTING: 'metrics:max_buckets',
ALLOW_STRING_INDICES: 'metrics:allowStringIndices',
ALLOW_CHECKING_FOR_FAILED_SHARDS: 'metrics:allowCheckingForFailedShards',
};
export const SERIES_SEPARATOR = '╰┄►';
export const INDEXES_SEPARATOR = ',';
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/vis_types/timeseries/public/metrics_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import {
extractIndexPatternValues,
isStringTypeIndexPattern,
} from '../common/index_patterns_utils';
import { TSVB_DEFAULT_COLOR, UI_SETTINGS, VIS_TYPE } from '../common/constants';
import { TSVB_DEFAULT_COLOR, VIS_TYPE } from '../common/constants';
import { toExpressionAst } from './to_ast';
import { getDataViewsStart, getUISettings } from './services';
import { getDataViewsStart } from './services';
import type { TimeseriesVisDefaultParams, TimeseriesVisParams } from './types';
import type { IndexPatternValue, Panel } from '../common/types';

Expand Down Expand Up @@ -188,6 +188,5 @@ export const metricsVisDefinition: VisTypeDefinition<
requests: new RequestAdapter(),
}),
requiresSearch: true,
suppressWarnings: () => !getUISettings().get(UI_SETTINGS.ALLOW_CHECKING_FOR_FAILED_SHARDS),
getUsedIndexPattern: getUsedIndexPatterns,
};
14 changes: 0 additions & 14 deletions src/plugins/vis_types/timeseries/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,4 @@ export const getUiSettings: () => Record<string, UiSettingsParams> = () => ({
}),
schema: schema.boolean(),
},
[UI_SETTINGS.ALLOW_CHECKING_FOR_FAILED_SHARDS]: {
name: i18n.translate('visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsTitle', {
defaultMessage: 'Show TSVB request shard failures',
}),
value: true,
description: i18n.translate(
'visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsText',
{
defaultMessage:
'Show warning message for partial data in TSVB charts if the request succeeds for some shards but fails for others.',
}
),
schema: schema.boolean(),
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ export class VisualizeEmbeddable
);
return true;
}
if (this.vis.type.suppressWarnings?.()) {
// if the vis type wishes to supress all warnings, return true so the default logic won't pick it up
return true;
}
});
}

Expand Down
2 changes: 0 additions & 2 deletions src/plugins/visualizations/public/vis_types/base_vis_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class BaseVisType<TVisParams extends VisParams = VisParams> {
public readonly disableCreate;
public readonly disableEdit;
public readonly requiresSearch;
public readonly suppressWarnings;
public readonly hasPartialRows;
public readonly hierarchicalData;
public readonly setup;
Expand All @@ -70,7 +69,6 @@ export class BaseVisType<TVisParams extends VisParams = VisParams> {
this.icon = opts.icon;
this.image = opts.image;
this.order = opts.order ?? 0;
this.suppressWarnings = opts.suppressWarnings;
this.visConfig = defaultsDeep({}, opts.visConfig, { defaults: {} });
this.editorConfig = defaultsDeep({}, opts.editorConfig, { collections: {} });
this.options = defaultsDeep({}, opts.options, defaultOptions);
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -9090,8 +9090,6 @@
"visTypeTimeseries.addDeleteButtons.deleteButtonDefaultTooltip": "Supprimer",
"visTypeTimeseries.addDeleteButtons.reEnableTooltip": "Réactiver",
"visTypeTimeseries.addDeleteButtons.temporarilyDisableTooltip": "Désactiver temporairement",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsText": "Afficher un message d'avertissement pour les données partielles dans les graphiques TSVB si la requête réussit pour certaines partitions, mais échoue pour d'autres.",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsTitle": "Afficher les échecs de partition de requête TSVB",
"visTypeTimeseries.advancedSettings.allowStringIndicesText": "Vous permet d'interroger les index Elasticsearch dans les visualisations <strong>TSVB</strong>.",
"visTypeTimeseries.advancedSettings.allowStringIndicesTitle": "Autoriser les index de chaîne dans TSVB",
"visTypeTimeseries.advancedSettings.maxBucketsText": "A un impact sur la densité de l'histogramme TSVB. Doit être défini sur une valeur supérieure à \"histogram:maxBars\".",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -9079,8 +9079,6 @@
"visTypeTimeseries.addDeleteButtons.deleteButtonDefaultTooltip": "削除",
"visTypeTimeseries.addDeleteButtons.reEnableTooltip": "再度有効にする",
"visTypeTimeseries.addDeleteButtons.temporarilyDisableTooltip": "一時的に無効にする",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsText": "一部のシャードでリクエストが成功し、その他のシャードで失敗した場合に、TSVBグラフの部分データに関する警告メッセージを表示します。",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsTitle": "TSVBリクエストシャード失敗",
"visTypeTimeseries.advancedSettings.allowStringIndicesText": "<strong>TSVB</strong>ビジュアライゼーションでElasticsearchインデックスをクエリーできます。",
"visTypeTimeseries.advancedSettings.allowStringIndicesTitle": "TSVBで文字列インデックスを許可",
"visTypeTimeseries.advancedSettings.maxBucketsText": "TSVBヒストグラム密度に影響します。「histogram:maxBars」よりも大きく設定する必要があります。",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -8902,8 +8902,6 @@
"visTypeTimeseries.addDeleteButtons.deleteButtonDefaultTooltip": "删除",
"visTypeTimeseries.addDeleteButtons.reEnableTooltip": "重新启用",
"visTypeTimeseries.addDeleteButtons.temporarilyDisableTooltip": "暂时禁用",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsText": "如果请求对某些分片成功,但对其他分片失败,将对 TSVB 图表中的部分数据显示警告消息。",
"visTypeTimeseries.advancedSettings.allowCheckingForFailedShardsTitle": "显示 TSVB 请求分片失败",
"visTypeTimeseries.advancedSettings.allowStringIndicesText": "允许您在 <strong>TSVB</strong> 可视化中查询 Elasticsearch 索引。",
"visTypeTimeseries.advancedSettings.allowStringIndicesTitle": "TSVB 中允许字符串索引",
"visTypeTimeseries.advancedSettings.maxBucketsText": "影响 TSVB 直方图密度。必须设置为高于'histogram:maxBars'。",
Expand Down

0 comments on commit 6fc010c

Please sign in to comment.