Skip to content

Commit

Permalink
[APM] Don't use transaction metrics if set to never (#117370) (#117415)
Browse files Browse the repository at this point in the history
Closes #117226.

Co-authored-by: Dario Gieselaar <[email protected]>
  • Loading branch information
kibanamachine and dgieselaar authored Nov 3, 2021
1 parent 90f8a90 commit 1366707
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,23 @@ export async function getSearchAggregatedTransactions({
apmEventClient: APMEventClient;
kuery: string;
}): Promise<boolean> {
const searchAggregatedTransactions = config.searchAggregatedTransactions;
switch (config.searchAggregatedTransactions) {
case SearchAggregatedTransactionSetting.always:
return kuery
? getHasAggregatedTransactions({ start, end, apmEventClient, kuery })
: true;

if (
kuery ||
searchAggregatedTransactions === SearchAggregatedTransactionSetting.auto
) {
return getHasAggregatedTransactions({ start, end, apmEventClient, kuery });
}
case SearchAggregatedTransactionSetting.auto:
return getHasAggregatedTransactions({
start,
end,
apmEventClient,
kuery,
});

return (
searchAggregatedTransactions === SearchAggregatedTransactionSetting.always
);
case SearchAggregatedTransactionSetting.never:
return false;
}
}

export function getTransactionDurationFieldForAggregatedTransactions(
Expand Down

0 comments on commit 1366707

Please sign in to comment.