Skip to content

Commit

Permalink
[APM] Don't use transaction metrics if set to never (#117370) (#117420)
Browse files Browse the repository at this point in the history
Closes #117226.
# Conflicts:
#	x-pack/plugins/apm/server/lib/helpers/transactions/index.ts

Co-authored-by: Dario Gieselaar <[email protected]>
  • Loading branch information
smith and dgieselaar authored Nov 3, 2021
1 parent 5ec18d0 commit 6fce737
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,21 @@ export async function getSearchAggregatedTransactions({
const searchAggregatedTransactions =
config['xpack.apm.searchAggregatedTransactions'];

if (
kuery ||
searchAggregatedTransactions === SearchAggregatedTransactionSetting.auto
) {
return getHasAggregatedTransactions({ start, end, apmEventClient, kuery });
switch (searchAggregatedTransactions) {
case SearchAggregatedTransactionSetting.always:
return kuery
? getHasAggregatedTransactions({ start, end, apmEventClient, kuery })
: true;
case SearchAggregatedTransactionSetting.auto:
return getHasAggregatedTransactions({
start,
end,
apmEventClient,
kuery,
});
case SearchAggregatedTransactionSetting.never:
return false;
}

return (
searchAggregatedTransactions === SearchAggregatedTransactionSetting.always
);
}

export function getTransactionDurationFieldForAggregatedTransactions(
Expand Down

0 comments on commit 6fce737

Please sign in to comment.