Skip to content

Commit 367b3d8

Browse files
Merge branch 'main' into 136039-rules-status
2 parents 49d07a1 + bebcd35 commit 367b3d8

5 files changed

Lines changed: 48 additions & 26 deletions

File tree

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('Lens Attribute', () => {
108108
to: 'now',
109109
},
110110
dataView: mockDataView,
111-
name: 'ux-series-1',
111+
name: 'Page load time',
112112
breakdown: 'percentile',
113113
reportDefinitions: {},
114114
selectedMetricField: 'transaction.duration.us',
@@ -139,7 +139,7 @@ describe('Lens Attribute', () => {
139139
query: 'transaction.type: page-load and processor.event: transaction',
140140
},
141141
isBucketed: false,
142-
label: `${rank} percentile of page load time`,
142+
label: 'Page load time',
143143
operationType: 'percentile',
144144
params: {
145145
percentile: Number(rank.slice(0, 2)),

x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,13 @@ export class LensAttributes {
331331
columnType,
332332
columnFilter,
333333
operationType,
334-
shortLabel,
335334
}: {
336335
sourceField: string;
337336
columnType?: string;
338337
columnFilter?: ColumnFilter;
339338
operationType?: SupportedOperations | 'last_value';
340339
label?: string;
341340
seriesConfig: SeriesConfig;
342-
shortLabel?: boolean;
343341
}) {
344342
if (columnType === 'operation' || operationType) {
345343
if (
@@ -352,7 +350,6 @@ export class LensAttributes {
352350
label,
353351
seriesConfig,
354352
columnFilter,
355-
shortLabel,
356353
});
357354
}
358355
if (operationType === 'last_value') {
@@ -365,7 +362,7 @@ export class LensAttributes {
365362
});
366363
}
367364
if (operationType?.includes('th')) {
368-
return this.getPercentileNumberColumn(sourceField, operationType, seriesConfig!);
365+
return this.getPercentileNumberColumn(sourceField, operationType, seriesConfig!, label);
369366
}
370367
}
371368
return this.getNumberRangeColumn(sourceField, seriesConfig!, label);
@@ -402,14 +399,12 @@ export class LensAttributes {
402399
seriesConfig,
403400
operationType,
404401
columnFilter,
405-
shortLabel,
406402
}: {
407403
sourceField: string;
408404
operationType: SupportedOperations;
409405
label?: string;
410406
seriesConfig: SeriesConfig;
411407
columnFilter?: ColumnFilter;
412-
shortLabel?: boolean;
413408
}):
414409
| MinIndexPatternColumn
415410
| MaxIndexPatternColumn
@@ -469,14 +464,17 @@ export class LensAttributes {
469464
getPercentileNumberColumn(
470465
sourceField: string,
471466
percentileValue: string,
472-
seriesConfig: SeriesConfig
467+
seriesConfig: SeriesConfig,
468+
label?: string
473469
): PercentileIndexPatternColumn {
474470
return {
475471
...buildNumberColumn(sourceField),
476-
label: i18n.translate('xpack.observability.expView.columns.label', {
477-
defaultMessage: '{percentileValue} percentile of {sourceField}',
478-
values: { sourceField: seriesConfig.labels[sourceField]?.toLowerCase(), percentileValue },
479-
}),
472+
label:
473+
label ??
474+
i18n.translate('xpack.observability.expView.columns.label', {
475+
defaultMessage: '{percentileValue} percentile of {sourceField}',
476+
values: { sourceField: seriesConfig.labels[sourceField]?.toLowerCase(), percentileValue },
477+
}),
480478
operationType: 'percentile',
481479
params: getPercentileParam(percentileValue),
482480
customLabel: true,
@@ -552,7 +550,6 @@ export class LensAttributes {
552550
colIndex,
553551
layerId,
554552
metricOption,
555-
shortLabel,
556553
}: {
557554
sourceField: string;
558555
metricOption?: MetricOption;
@@ -561,7 +558,6 @@ export class LensAttributes {
561558
layerId: string;
562559
layerConfig: LayerConfig;
563560
colIndex?: number;
564-
shortLabel?: boolean;
565561
}) {
566562
const { breakdown, seriesConfig } = layerConfig;
567563
const fieldMetaInfo = this.getFieldMeta(sourceField, layerConfig, metricOption);
@@ -614,7 +610,8 @@ export class LensAttributes {
614610
...this.getPercentileNumberColumn(
615611
fieldName,
616612
operationType || PERCENTILE_RANKS[0],
617-
seriesConfig!
613+
seriesConfig!,
614+
label || columnLabel
618615
),
619616
filter: colIndex !== undefined ? columnFilters?.[colIndex] : undefined,
620617
};
@@ -628,7 +625,6 @@ export class LensAttributes {
628625
operationType,
629626
label: label || columnLabel,
630627
seriesConfig: layerConfig.seriesConfig,
631-
shortLabel,
632628
});
633629
}
634630
if (operationType === 'unique_count' || fieldType === 'string') {
@@ -745,7 +741,6 @@ export class LensAttributes {
745741
return this.getColumnBasedOnType({
746742
layerConfig,
747743
layerId,
748-
shortLabel: true,
749744
label: item.label,
750745
sourceField: REPORT_METRIC_FIELD,
751746
metricOption: item,

x-pack/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_trend.tsx

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import React from 'react';
99
import { useKibana } from '@kbn/kibana-react-plugin/public';
10+
import { i18n } from '@kbn/i18n';
1011
import { ClientPluginsStart } from '../../../../../plugin';
1112
import { useMonitorQueryId } from '../hooks/use_monitor_query_id';
1213
import { useSelectedLocation } from '../hooks/use_selected_location';
@@ -24,8 +25,6 @@ export const MonitorDurationTrend = (props: MonitorDurationTrendProps) => {
2425
const monitorId = useMonitorQueryId();
2526
const selectedLocation = useSelectedLocation();
2627

27-
const metricsToShow = ['min', 'max', 'median', '25th', '75th'];
28-
2928
if (!selectedLocation) {
3029
return null;
3130
}
@@ -34,10 +33,10 @@ export const MonitorDurationTrend = (props: MonitorDurationTrendProps) => {
3433
<ExploratoryViewEmbeddable
3534
customHeight="240px"
3635
reportType="kpi-over-time"
37-
attributes={metricsToShow.map((metric) => ({
36+
attributes={Object.keys(metricsToShow).map((metric) => ({
3837
dataType: 'synthetics',
3938
time: props,
40-
name: metric + ' Series',
39+
name: metricsToShow[metric],
4140
selectedMetricField: 'monitor.duration.us',
4241
reportDefinitions: {
4342
'monitor.id': [monitorId],
@@ -49,3 +48,31 @@ export const MonitorDurationTrend = (props: MonitorDurationTrendProps) => {
4948
/>
5049
);
5150
};
51+
52+
const MIN_LABEL = i18n.translate('xpack.synthetics.durationTrend.min', {
53+
defaultMessage: 'Min',
54+
});
55+
56+
const MAX_LABEL = i18n.translate('xpack.synthetics.durationTrend.max', {
57+
defaultMessage: 'Max',
58+
});
59+
60+
const MEDIAN_LABEL = i18n.translate('xpack.synthetics.durationTrend.median', {
61+
defaultMessage: 'Median',
62+
});
63+
64+
const PERCENTILE_25_LABEL = i18n.translate('xpack.synthetics.durationTrend.percentile25', {
65+
defaultMessage: '25th',
66+
});
67+
68+
const PERCENTILE_75_LABEL = i18n.translate('xpack.synthetics.durationTrend.percentile75', {
69+
defaultMessage: '75th',
70+
});
71+
72+
const metricsToShow: Record<string, string> = {
73+
max: MAX_LABEL,
74+
'75th': PERCENTILE_75_LABEL,
75+
median: MEDIAN_LABEL,
76+
'25th': PERCENTILE_25_LABEL,
77+
min: MIN_LABEL,
78+
};

x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugins/synthetics/public/legacy_uptime/components/overview/alerts/translations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ export const ENTER_NUMBER_OF_DOWN_COUNTS = i18n.translate(
117117
export const MATCHING_MONITORS_DOWN = i18n.translate(
118118
'xpack.synthetics.alerts.monitorStatus.numTimesExpression.matchingMonitors.description',
119119
{
120-
defaultMessage: 'matching monitors are down >',
120+
defaultMessage: 'matching monitors are down >=',
121121
}
122122
);
123123

124124
export const ANY_MONITOR_DOWN = i18n.translate(
125125
'xpack.synthetics.alerts.monitorStatus.numTimesExpression.anyMonitors.description',
126126
{
127-
defaultMessage: 'any monitor is down >',
127+
defaultMessage: 'any monitor is down >=',
128128
}
129129
);
130130

0 commit comments

Comments
 (0)