Skip to content

Commit

Permalink
Merge branch 'main' into 150607_epm_failing_test
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 29, 2023
2 parents 85c2da0 + 01098bc commit b57a22b
Show file tree
Hide file tree
Showing 219 changed files with 2,747 additions and 1,497 deletions.
1 change: 0 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ disabled:
- x-pack/plugins/synthetics/e2e/config.ts
- x-pack/plugins/synthetics/e2e/synthetics_run.ts
- x-pack/plugins/ux/e2e/synthetics_run.ts
- x-pack/plugins/observability/e2e/synthetics_run.ts
- x-pack/plugins/exploratory_view/e2e/synthetics_run.ts

# Configs that exist but weren't running in CI when this file was introduced
Expand Down
15 changes: 0 additions & 15 deletions .buildkite/pipelines/pull_request/observability_plugin.yml

This file was deleted.

13 changes: 1 addition & 12 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,31 +137,20 @@ const uploadPipeline = (pipelineContent: string | object) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml'));
}

if (await doAnyChangesMatch([/^x-pack\/plugins\/observability/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/observability_plugin.yml'));
}

if (await doAnyChangesMatch([/^x-pack\/plugins\/exploratory_view/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/exploratory_view_plugin.yml'));
}

if (
await doAnyChangesMatch([
/^x-pack\/plugins\/synthetics/,
/^x-pack\/plugins\/observability\/public\/components\/shared\/exploratory_view/,
/^x-pack\/plugins\/exploratory_view/,
])
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/synthetics_plugin.yml'));
}

if (
await doAnyChangesMatch([
/^x-pack\/plugins\/ux/,
/^x-pack\/plugins\/observability\/public\/components\/shared\/exploratory_view/,
/^x-pack\/plugins\/exploratory_view/,
])
) {
if (await doAnyChangesMatch([/^x-pack\/plugins\/ux/, /^x-pack\/plugins\/exploratory_view/])) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/ux_plugin_e2e.yml'));
}

Expand Down
1 change: 0 additions & 1 deletion packages/kbn-ts-projects/ts_projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const TS_PROJECTS = TsProject.loadAll({

'x-pack/plugins/synthetics/e2e/tsconfig.json',
'x-pack/plugins/ux/e2e/tsconfig.json',
'x-pack/plugins/observability/e2e/tsconfig.json',
'x-pack/plugins/exploratory_view/e2e/tsconfig.json',
'x-pack/plugins/threat_intelligence/cypress/tsconfig.json',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ describe('getConfigurationForGauge', () => {
palette: undefined,
maxAccessor: maxColumnId,
color: '#FFFFFF',
showBar: true,
});
expect(mockGetPalette).toBeCalledTimes(1);
});
Expand Down Expand Up @@ -338,6 +339,7 @@ describe('getConfigurationForGauge', () => {
metricAccessor: columnId1,
palette,
maxAccessor: maxColumnId,
showBar: true,
});
expect(mockGetPalette).toBeCalledTimes(1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const getConfigurationForGauge = (
model: Panel,
layer: Layer,
bucket: Column | undefined,
gaugeMaxColumn: Column
gaugeMaxColumn?: Column
): MetricVisConfiguration | null => {
const primarySeries = model.series[0];
const primaryMetricWithCollapseFn = getMetricWithCollapseFn(primarySeries);
Expand All @@ -73,7 +73,8 @@ export const getConfigurationForGauge = (
layerType: 'data',
metricAccessor: primaryColumn?.columnId,
breakdownByAccessor: bucket?.columnId,
maxAccessor: gaugeMaxColumn.columnId,
maxAccessor: gaugeMaxColumn?.columnId,
showBar: Boolean(gaugeMaxColumn),
palette: gaugePalette,
collapseFn: primaryMetricWithCollapseFn.collapseFn,
...(gaugePalette ? {} : { color: primaryColor }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { FieldFormatter, MIN_ZOOM, MAX_ZOOM } from '@kbn/maps-plugin/common';
import type {
AbstractSourceDescriptor,
Attribution,
DataFilters,
DataRequestMeta,
SourceRequestMeta,
Timeslice,
} from '@kbn/maps-plugin/common/descriptor_types';
import type {
Expand Down Expand Up @@ -102,10 +102,6 @@ export class CustomRasterSource implements IRasterSource {
return false;
}

isGeoGridPrecisionAware(): boolean {
return false;
}

isQueryAware(): boolean {
return false;
}
Expand Down Expand Up @@ -138,10 +134,6 @@ export class CustomRasterSource implements IRasterSource {
return [];
}

getGeoGridPrecision(zoom: number): number {
return 0;
}

isESSource(): boolean {
return false;
}
Expand Down Expand Up @@ -179,11 +171,11 @@ export class CustomRasterSource implements IRasterSource {
return true;
}

async getUrlTemplate(dataFilters: DataFilters): Promise<string> {
async getUrlTemplate(requestMeta: SourceRequestMeta): Promise<string> {
const defaultUrl =
'https://new.nowcoast.noaa.gov/arcgis/rest/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/export?dpi=96&transparent=true&format=png32&time={time}&layers=show%3A3&bbox=-{bbox-epsg-3857}&bboxSR=3857&imageSR=3857&size=256%2C256&f=image';

const { timeslice, timeFilters } = dataFilters;
const { timeslice, timeFilters } = requestMeta;
let timestamp;

if (timeslice) {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/apm/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"inspector",
"licensing",
"observability",
"exploratoryView",
"ruleRegistry",
"triggersActionsUi",
"share",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { APIReturnType } from '../../../../services/rest/create_call_apm_api';
import { errorRateI18n } from '../../../shared/charts/failed_transaction_rate_chart';
import { TimeseriesChart } from '../../../shared/charts/timeseries_chart';
import { yLabelFormat } from './helpers';
import { usePreferredDataSourceAndBucketSize } from '../../../../hooks/use_preferred_data_source_and_bucket_size';
import { ApmDocumentType } from '../../../../../common/document_type';

type ErrorRate =
APIReturnType<'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate'>;
Expand Down Expand Up @@ -59,9 +61,17 @@ function FailedTransactionChart({
const { currentPeriodColor: currentPeriodColorErrorRate } =
get_timeseries_color.getTimeSeriesColor(ChartType.FAILED_TRANSACTION_RATE);

const preferred = usePreferredDataSourceAndBucketSize({
start,
end,
kuery: '',
numBuckets: 100,
type: ApmDocumentType.ServiceTransactionMetric,
});

const { data: dataErrorRate = INITIAL_STATE_ERROR_RATE, status } = useFetcher(
(callApmApi) => {
if (transactionType && serviceName && start && end) {
if (transactionType && serviceName && start && end && preferred) {
return callApmApi(
'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate',
{
Expand All @@ -76,13 +86,16 @@ function FailedTransactionChart({
end,
transactionType,
transactionName: undefined,
documentType: preferred.source.documentType,
rollupInterval: preferred.source.rollupInterval,
bucketSizeInSeconds: preferred.bucketSizeInSeconds,
},
},
}
);
}
},
[environment, serviceName, start, end, transactionType]
[environment, serviceName, start, end, transactionType, preferred]
);
const timeseriesErrorRate = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
import { useFetcher } from '../../../../hooks/use_fetcher';
import { TimeseriesChart } from '../../../shared/charts/timeseries_chart';
import { getResponseTimeTickFormatter } from '../../../shared/charts/transaction_charts/helper';
import { usePreferredDataSourceAndBucketSize } from '../../../../hooks/use_preferred_data_source_and_bucket_size';
import { ApmDocumentType } from '../../../../../common/document_type';

const INITIAL_STATE = {
currentPeriod: [],
Expand Down Expand Up @@ -54,10 +56,19 @@ function ThroughputChart({
timeZone: string;
}) {
/* Throughput Chart */

const preferred = usePreferredDataSourceAndBucketSize({
start,
end,
numBuckets: 100,
kuery: '',
type: ApmDocumentType.ServiceTransactionMetric,
});

const { data: dataThroughput = INITIAL_STATE, status: statusThroughput } =
useFetcher(
(callApmApi) => {
if (serviceName && transactionType && start && end) {
if (serviceName && transactionType && start && end && preferred) {
return callApmApi(
'GET /internal/apm/services/{serviceName}/throughput',
{
Expand All @@ -72,13 +83,16 @@ function ThroughputChart({
end,
transactionType,
transactionName: undefined,
documentType: preferred.source.documentType,
rollupInterval: preferred.source.rollupInterval,
bucketSizeInSeconds: preferred.bucketSizeInSeconds,
},
},
}
);
}
},
[environment, serviceName, start, end, transactionType]
[environment, serviceName, start, end, transactionType, preferred]
);
const { currentPeriodColor, previousPeriodColor } = getTimeSeriesColor(
ChartType.THROUGHPUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
ChartType,
getTimeSeriesColor,
} from '../../shared/charts/helper/get_timeseries_color';
import { usePreferredDataSourceAndBucketSize } from '../../../hooks/use_preferred_data_source_and_bucket_size';
import { ApmDocumentType } from '../../../../common/document_type';

const INITIAL_STATE = {
currentPeriod: [],
Expand Down Expand Up @@ -60,6 +62,14 @@ export function ServiceOverviewThroughputChart({

const { start, end } = useTimeRange({ rangeFrom, rangeTo });

const preferred = usePreferredDataSourceAndBucketSize({
start,
end,
numBuckets: 100,
kuery,
type: ApmDocumentType.ServiceTransactionMetric,
});

const { transactionType, serviceName, transactionTypeStatus } =
useApmServiceContext();

Expand All @@ -71,7 +81,7 @@ export function ServiceOverviewThroughputChart({
return Promise.resolve(INITIAL_STATE);
}

if (serviceName && transactionType && start && end) {
if (serviceName && transactionType && start && end && preferred) {
return callApmApi(
'GET /internal/apm/services/{serviceName}/throughput',
{
Expand All @@ -90,6 +100,9 @@ export function ServiceOverviewThroughputChart({
? offset
: undefined,
transactionName,
documentType: preferred.source.documentType,
rollupInterval: preferred.source.rollupInterval,
bucketSizeInSeconds: preferred.bucketSizeInSeconds,
},
},
}
Expand All @@ -107,6 +120,7 @@ export function ServiceOverviewThroughputChart({
offset,
transactionName,
comparisonEnabled,
preferred,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('AnalyzeDataButton', () => {
render(<Example agentName="rum-js" />);

expect((screen.getByRole('link') as HTMLAnchorElement).href).toEqual(
'http://localhost/app/observability/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:ux,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(testEnvironment),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
'http://localhost/app/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:ux,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(testEnvironment),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
);
});
});
Expand All @@ -48,7 +48,7 @@ describe('AnalyzeDataButton', () => {
render(<Example agentName="iOS/swift" />);

expect((screen.getByRole('link') as HTMLAnchorElement).href).toEqual(
'http://localhost/app/observability/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(testEnvironment),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
'http://localhost/app/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(testEnvironment),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
);
});
});
Expand All @@ -58,7 +58,7 @@ describe('AnalyzeDataButton', () => {
render(<Example environment={ENVIRONMENT_NOT_DEFINED.value} />);

expect((screen.getByRole('link') as HTMLAnchorElement).href).toEqual(
'http://localhost/app/observability/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(ENVIRONMENT_NOT_DEFINED),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
'http://localhost/app/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(ENVIRONMENT_NOT_DEFINED),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
);
});
});
Expand All @@ -68,7 +68,7 @@ describe('AnalyzeDataButton', () => {
render(<Example environment={ENVIRONMENT_ALL.value} />);

expect((screen.getByRole('link') as HTMLAnchorElement).href).toEqual(
'http://localhost/app/observability/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(ALL_VALUES),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
'http://localhost/app/exploratory-view/#?reportType=kpi-over-time&sr=!((dt:mobile,mt:transaction.duration.us,n:testServiceName-response-latency,op:average,rdf:(service.environment:!(ALL_VALUES),service.name:!(testServiceName)),time:(from:now-15m,to:now)))'
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { EuiButtonEmpty, EuiToolTip } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { createExploratoryViewUrl } from '@kbn/observability-plugin/public';
import { ALL_VALUES_SELECTED } from '@kbn/observability-plugin/public';
import { createExploratoryViewUrl } from '@kbn/exploratory-view-plugin/public';
import { ALL_VALUES_SELECTED } from '@kbn/exploratory-view-plugin/public';
import {
isMobileAgentName,
isRumAgentName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { useEnvironmentsContext } from '../../../../context/environments_context
import { ApmMlDetectorType } from '../../../../../common/anomaly_detection/apm_ml_detectors';
import { usePreferredServiceAnomalyTimeseries } from '../../../../hooks/use_preferred_service_anomaly_timeseries';
import { ChartType, getTimeSeriesColor } from '../helper/get_timeseries_color';
import { usePreferredDataSourceAndBucketSize } from '../../../../hooks/use_preferred_data_source_and_bucket_size';
import { ApmDocumentType } from '../../../../../common/document_type';

function yLabelFormat(y?: number | null) {
return asPercent(y || 0, 1);
Expand Down Expand Up @@ -71,6 +73,14 @@ export function FailedTransactionRateChart({

const { start, end } = useTimeRange({ rangeFrom, rangeTo });

const preferred = usePreferredDataSourceAndBucketSize({
start,
end,
numBuckets: 100,
kuery,
type: ApmDocumentType.ServiceTransactionMetric,
});

const { environment } = useEnvironmentsContext();

const preferredAnomalyTimeseries = usePreferredServiceAnomalyTimeseries(
Expand All @@ -88,7 +98,7 @@ export function FailedTransactionRateChart({
return Promise.resolve(INITIAL_STATE);
}

if (transactionType && serviceName && start && end) {
if (transactionType && serviceName && start && end && preferred) {
return callApmApi(
'GET /internal/apm/services/{serviceName}/transactions/charts/error_rate',
{
Expand All @@ -107,6 +117,9 @@ export function FailedTransactionRateChart({
comparisonEnabled && isTimeComparison(offset)
? offset
: undefined,
documentType: preferred.source.documentType,
rollupInterval: preferred.source.rollupInterval,
bucketSizeInSeconds: preferred.bucketSizeInSeconds,
},
},
}
Expand All @@ -124,6 +137,7 @@ export function FailedTransactionRateChart({
transactionName,
offset,
comparisonEnabled,
preferred,
]
);

Expand Down
Loading

0 comments on commit b57a22b

Please sign in to comment.