diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts index f7503acf77179..b2bdc063f26ee 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts @@ -857,6 +857,7 @@ export class LensAttributes { dataType: 'number', isBucketed: false, label: label || 'Count of records', + customLabel: true, operationType: 'count', scale: 'ratio', sourceField: RECORDS_FIELD, diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts index b13f072cc5e64..6fdb18750990e 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts @@ -14,6 +14,7 @@ import { PERCENTILE, ReportTypes, FORMULA_COLUMN, + RECORDS_FIELD, } from '../constants'; import { CLS_LABEL, @@ -124,8 +125,8 @@ export function getSyntheticsKPIConfig({ dataView }: ConfigProps): SeriesConfig }, { label: 'Total runs', - id: 'monitor.check_group', - field: 'monitor.check_group', + id: 'total_test_runs', + field: RECORDS_FIELD, columnType: OPERATION_COLUMN, columnFilters: [ { diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts index cae5b16a41584..ed0df54219a29 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts @@ -103,8 +103,9 @@ export function getSyntheticsSingleMetricConfig({ dataView }: ConfigProps): Seri titlePosition: 'bottom', }, columnType: FORMULA_COLUMN, - formula: "unique_count(monitor.check_group, kql='summary: *')", format: 'number', + field: RECORDS_FIELD, + columnFilter: { language: 'kuery', query: 'summary: *' }, }, { id: 'monitor_successful', @@ -114,9 +115,9 @@ export function getSyntheticsSingleMetricConfig({ dataView }: ConfigProps): Seri metricStateOptions: { titlePosition: 'bottom', }, - columnType: FORMULA_COLUMN, - formula: 'unique_count(monitor.check_group, kql=\'monitor.status: "up"\')', format: 'number', + field: RECORDS_FIELD, + columnFilter: { language: 'kuery', query: 'summary.down: 0' }, }, { id: 'monitor_errors', diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts index 5c09be2382425..9364977451b48 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts @@ -54,6 +54,7 @@ export const sampleAttributeCoreWebVital = { sourceField: 'user_agent.os.name', }, 'y-axis-column-1': { + customLabel: true, dataType: 'number', filter: { language: 'kuery', @@ -67,6 +68,7 @@ export const sampleAttributeCoreWebVital = { sourceField: RECORDS_FIELD, }, 'y-axis-column-2': { + customLabel: true, dataType: 'number', filter: { language: 'kuery', @@ -79,6 +81,7 @@ export const sampleAttributeCoreWebVital = { sourceField: RECORDS_FIELD, }, 'y-axis-column-layer0-0': { + customLabel: true, dataType: 'number', filter: { language: 'kuery', diff --git a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts index 49787f1304859..af5d7a91a541d 100644 --- a/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts +++ b/x-pack/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts @@ -50,6 +50,7 @@ export const sampleAttributeKpi = { }, isBucketed: false, label: 'test-series', + customLabel: true, operationType: 'count', scale: 'ratio', sourceField: RECORDS_FIELD, diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx index d8ba47ef7f39c..c2930a1d22ffb 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx @@ -32,11 +32,11 @@ export const MonitorTestRunsSparkline = ({ monitorIds }: { monitorIds: string[] 'monitor.id': monitorIds.length > 0 ? monitorIds : ['false-monitor-id'], // Show no data when monitorIds is empty }, dataType: 'synthetics' as const, - selectedMetricField: 'monitor.check_group', + selectedMetricField: 'total_test_runs', filters: [], name: labels.TEST_RUNS_LABEL, color: theme.eui.euiColorVis1, - operationType: 'unique_count', + operationType: 'count', }, ]; // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts index 9008ff9b33100..ae5ceca74fdd1 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/lib/lib.ts @@ -24,7 +24,6 @@ import { DYNAMIC_SETTINGS_DEFAULT_ATTRIBUTES } from '../../constants/settings'; import { DynamicSettingsAttributes } from '../../runtime_types/settings'; import { settingsObjectId, umDynamicSettings } from './saved_objects/uptime_settings'; import { API_URLS } from '../../../common/constants'; -import { UptimeServerSetup } from './adapters'; export type { UMServerLibs } from '../uptime_server'; @@ -287,7 +286,3 @@ export function debugESCall({ } console.log(`\n`); } - -export const isTestUser = (server: UptimeServerSetup) => { - return server.config.service?.username === 'localKibanaIntegrationTestsUser'; -}; diff --git a/x-pack/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts b/x-pack/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts index 3e92f73efab10..5beaa563790e8 100644 --- a/x-pack/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts +++ b/x-pack/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts @@ -7,7 +7,7 @@ import { KibanaResponse } from '@kbn/core-http-router-server-internal'; import { UMKibanaRouteWrapper } from './types'; -import { isTestUser, UptimeEsClient } from '../lib/lib'; +import { UptimeEsClient } from '../lib/lib'; export const uptimeRouteWrapper: UMKibanaRouteWrapper = (uptimeRoute, server) => ({ ...uptimeRoute, @@ -24,7 +24,7 @@ export const uptimeRouteWrapper: UMKibanaRouteWrapper = (uptimeRoute, server) => { request, uiSettings: coreContext.uiSettings, - isDev: Boolean(server.isDev && !isTestUser(server)), + isDev: Boolean(server.isDev), } );