Skip to content

Commit 2ba9fbe

Browse files
committed
Merge branch 'master' of https://github.com/elastic/kibana into disk-usage-alerting
2 parents d7bca1c + 093f588 commit 2ba9fbe

File tree

123 files changed

+2091
-2733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2091
-2733
lines changed

x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap

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

x-pack/plugins/apm/common/elasticsearch_fieldnames.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,8 @@ export const TRANSACTION_URL = 'transaction.page.url';
9999
export const CLIENT_GEO = 'client.geo';
100100
export const USER_AGENT_DEVICE = 'user_agent.device.name';
101101
export const USER_AGENT_OS = 'user_agent.os.name';
102+
103+
export const TRANSACTION_TIME_TO_FIRST_BYTE =
104+
'transaction.marks.agent.timeToFirstByte';
105+
export const TRANSACTION_DOM_INTERACTIVE =
106+
'transaction.marks.agent.domInteractive';

x-pack/plugins/apm/public/components/app/RumDashboard/Charts/PageLoadDistChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { BreakdownSeries } from '../PageLoadDistribution/BreakdownSeries';
3535

3636
interface PageLoadData {
3737
pageLoadDistribution: Array<{ x: number; y: number }>;
38-
percentiles: Record<string, number> | undefined;
38+
percentiles: Record<string, number | null> | undefined;
3939
minDuration: number;
4040
maxDuration: number;
4141
}

x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/PercentileAnnotations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import styled from 'styled-components';
1616
import { EuiToolTip } from '@elastic/eui';
1717

1818
interface Props {
19-
percentiles?: Record<string, number>;
19+
percentiles?: Record<string, number | null>;
2020
}
2121

2222
function generateAnnotationData(
23-
values?: Record<string, number>
23+
values?: Record<string, number | null>
2424
): LineAnnotationDatum[] {
2525
return Object.entries(values ?? {}).map((value) => ({
2626
dataValue: value[1],

x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_anomaly_alert_type.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ export function registerTransactionDurationAnomalyAlertType({
7373
return;
7474
}
7575
const alertParams = params as TypeOf<typeof paramsSchema>;
76-
const mlClient = services.getLegacyScopedClusterClient(ml.mlClient);
77-
const request = { params: 'DummyKibanaRequest' } as KibanaRequest;
78-
const { mlAnomalySearch } = ml.mlSystemProvider(mlClient, request);
79-
const anomalyDetectors = ml.anomalyDetectorsProvider(mlClient, request);
76+
const request = {} as KibanaRequest;
77+
const { mlAnomalySearch } = ml.mlSystemProvider(request);
78+
const anomalyDetectors = ml.anomalyDetectorsProvider(request);
8079

8180
const mlJobIds = await getMLJobIds(
8281
anomalyDetectors,

x-pack/plugins/apm/server/lib/helpers/setup_request.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,10 @@ function getMlSetup(
122122
if (!ml) {
123123
return;
124124
}
125-
const mlClient = ml.mlClient.asScoped(request);
126-
const mlSystem = ml.mlSystemProvider(mlClient, request);
125+
127126
return {
128-
mlClient,
129-
mlSystem,
130-
modules: ml.modulesProvider(mlClient, request, savedObjectsClient),
131-
anomalyDetectors: ml.anomalyDetectorsProvider(mlClient, request),
132-
mlAnomalySearch: mlSystem.mlAnomalySearch,
127+
mlSystem: ml.mlSystemProvider(request),
128+
anomalyDetectors: ml.anomalyDetectorsProvider(request),
129+
modules: ml.modulesProvider(request, savedObjectsClient),
133130
};
134131
}

x-pack/plugins/apm/server/lib/rum_client/__snapshots__/queries.test.ts.snap

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

x-pack/plugins/apm/server/lib/rum_client/get_client_metrics.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import {
1111
SetupTimeRange,
1212
SetupUIFilters,
1313
} from '../helpers/setup_request';
14+
import {
15+
TRANSACTION_DOM_INTERACTIVE,
16+
TRANSACTION_TIME_TO_FIRST_BYTE,
17+
} from '../../../common/elasticsearch_fieldnames';
1418

1519
export async function getClientMetrics({
1620
setup,
@@ -30,15 +34,21 @@ export async function getClientMetrics({
3034
aggs: {
3135
pageViews: { value_count: { field: 'transaction.type' } },
3236
backEnd: {
33-
avg: {
34-
field: 'transaction.marks.agent.timeToFirstByte',
35-
missing: 0,
37+
percentiles: {
38+
field: TRANSACTION_TIME_TO_FIRST_BYTE,
39+
percents: [50],
40+
hdr: {
41+
number_of_significant_value_digits: 3,
42+
},
3643
},
3744
},
3845
domInteractive: {
39-
avg: {
40-
field: 'transaction.marks.agent.domInteractive',
41-
missing: 0,
46+
percentiles: {
47+
field: TRANSACTION_DOM_INTERACTIVE,
48+
percents: [50],
49+
hdr: {
50+
number_of_significant_value_digits: 3,
51+
},
4252
},
4353
},
4454
},
@@ -53,9 +63,11 @@ export async function getClientMetrics({
5363
// Divide by 1000 to convert ms into seconds
5464
return {
5565
pageViews,
56-
backEnd: { value: (backEnd.value || 0) / 1000 },
66+
backEnd: { value: (backEnd.values['50.0'] || 0) / 1000 },
5767
frontEnd: {
58-
value: ((domInteractive.value || 0) - (backEnd.value || 0)) / 1000,
68+
value:
69+
((domInteractive.values['50.0'] || 0) - (backEnd.values['50.0'] || 0)) /
70+
1000,
5971
},
6072
};
6173
}

x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function getItemsWithRelativeImpact(
6565
key: string | Record<string, any>;
6666
avg?: number | null;
6767
count?: number | null;
68-
p95?: number;
68+
p95?: number | null;
6969
sample?: Transaction;
7070
}>
7171
) {
@@ -188,7 +188,7 @@ export interface TransactionGroup {
188188
key: Record<string, any> | string;
189189
averageResponseTime: number | null | undefined;
190190
transactionsPerMinute: number;
191-
p95: number | undefined;
191+
p95: number | null | undefined;
192192
impact: number;
193193
sample: Transaction;
194194
}

x-pack/plugins/apm/typings/elasticsearch/aggregations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ interface AggregationResponsePart<
223223
value: number;
224224
};
225225
percentiles: {
226-
values: Record<string, number>;
226+
values: Record<string, number | null>;
227227
};
228228
extended_stats: {
229229
count: number;

0 commit comments

Comments
 (0)