Skip to content

Commit bef8e6f

Browse files
Merge branch '7.x' into backport/7.x/pr-72505
2 parents 5b46b90 + 8b5c6b3 commit bef8e6f

File tree

17 files changed

+6199
-7
lines changed

17 files changed

+6199
-7
lines changed

x-pack/plugins/apm/server/lib/observability_overview/has_data.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6+
import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames';
7+
import { ProcessorEvent } from '../../../common/processor_event';
68
import { Setup } from '../helpers/setup_request';
79

810
export async function hasData({ setup }: { setup: Setup }) {
@@ -15,7 +17,24 @@ export async function hasData({ setup }: { setup: Setup }) {
1517
indices['apm_oss.metricsIndices'],
1618
],
1719
terminateAfter: 1,
18-
size: 0,
20+
body: {
21+
size: 0,
22+
query: {
23+
bool: {
24+
filter: [
25+
{
26+
terms: {
27+
[PROCESSOR_EVENT]: [
28+
ProcessorEvent.error,
29+
ProcessorEvent.metric,
30+
ProcessorEvent.transaction,
31+
],
32+
},
33+
},
34+
],
35+
},
36+
},
37+
},
1938
};
2039

2140
const response = await client.search(params);

x-pack/plugins/apm/server/lib/transactions/avg_duration_by_browser/fetcher.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
TRANSACTION_TYPE,
1313
USER_AGENT_NAME,
1414
TRANSACTION_DURATION,
15+
TRANSACTION_NAME,
1516
} from '../../../../common/elasticsearch_fieldnames';
1617
import { rangeFilter } from '../../../../common/utils/range_filter';
1718
import { getBucketSize } from '../../helpers/get_bucket_size';
@@ -23,15 +24,20 @@ export type ESResponse = PromiseReturnType<typeof fetcher>;
2324

2425
export function fetcher(options: Options) {
2526
const { end, client, indices, start, uiFiltersES } = options.setup;
26-
const { serviceName } = options;
27+
const { serviceName, transactionName } = options;
2728
const { intervalString } = getBucketSize(start, end, 'auto');
2829

30+
const transactionNameFilter = transactionName
31+
? [{ term: { [TRANSACTION_NAME]: transactionName } }]
32+
: [];
33+
2934
const filter: ESFilter[] = [
3035
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
3136
{ term: { [SERVICE_NAME]: serviceName } },
3237
{ term: { [TRANSACTION_TYPE]: TRANSACTION_PAGE_LOAD } },
3338
{ range: rangeFilter(start, end) },
3439
...uiFiltersES,
40+
...transactionNameFilter,
3541
];
3642

3743
const params = {

x-pack/plugins/apm/server/lib/transactions/avg_duration_by_browser/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { transformer } from './transformer';
1616
export interface Options {
1717
serviceName: string;
1818
setup: Setup & SetupTimeRange & SetupUIFilters;
19+
transactionName?: string;
1920
}
2021

2122
export type AvgDurationByBrowserAPIResponse = Array<{

x-pack/plugins/apm/server/routes/transaction_groups.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ export const transactionGroupsAvgDurationByBrowser = createRoute(() => ({
164164
}),
165165
query: t.intersection([
166166
t.partial({
167-
transactionType: t.string,
168167
transactionName: t.string,
169168
}),
170169
uiFiltersRt,
@@ -174,10 +173,12 @@ export const transactionGroupsAvgDurationByBrowser = createRoute(() => ({
174173
handler: async ({ context, request }) => {
175174
const setup = await setupRequest(context, request);
176175
const { serviceName } = context.params.path;
176+
const { transactionName } = context.params.query;
177177

178178
return getTransactionAvgDurationByBrowser({
179179
serviceName,
180180
setup,
181+
transactionName,
181182
});
182183
},
183184
}));

x-pack/plugins/reporting/server/export_types/png/create_job/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
1313
JobParamsPNG
1414
>> = function createJobFactoryFn(reporting) {
1515
const config = reporting.getConfig();
16-
const setupDeps = reporting.getPluginSetupDeps();
1716
const crypto = cryptoFactory(config.get('encryptionKey'));
1817

1918
return async function scheduleTask(
@@ -32,7 +31,7 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
3231
headers: serializedEncryptedHeaders,
3332
browserTimezone,
3433
layout,
35-
basePath: setupDeps.basePath(req),
34+
basePath: config.kbnConfig.get('server', 'basePath'),
3635
forceNow: new Date().toISOString(),
3736
};
3837
};

x-pack/plugins/reporting/server/export_types/printable_pdf/create_job/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
1616
JobParamsPDF
1717
>> = function createJobFactoryFn(reporting, logger) {
1818
const config = reporting.getConfig();
19-
const setupDeps = reporting.getPluginSetupDeps();
2019
const crypto = cryptoFactory(config.get('encryptionKey'));
2120
const compatibilityShim = compatibilityShimFactory(logger);
2221

@@ -30,7 +29,7 @@ export const scheduleTaskFnFactory: ScheduleTaskFnFactory<ESQueueCreateJobFn<
3029
validateUrls(relativeUrls);
3130

3231
return {
33-
basePath: setupDeps.basePath(req),
32+
basePath: config.kbnConfig.get('server', 'basePath'),
3433
browserTimezone,
3534
forceNow: new Date().toISOString(),
3635
headers: serializedEncryptedHeaders,
Binary file not shown.

0 commit comments

Comments
 (0)