Skip to content

Commit

Permalink
[APM] Check kibana advanced settings to set comparison enabled (#119484
Browse files Browse the repository at this point in the history
…) (#119547)

* using kibana adv settings to set comparison enabled

* adding comparison enabled
# Conflicts:
#	x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/MaybeViewTraceLink.tsx
#	x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx
  • Loading branch information
cauemarcondes authored Nov 23, 2021
1 parent e66604f commit 7087317
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function MaybeViewTraceLink({
environment: Environment;
}) {
const {
urlParams: { latencyAggregationType },
urlParams: { latencyAggregationType, comparisonEnabled, comparisonType },
} = useUrlParams();

const viewFullTraceButtonLabel = i18n.translate(
Expand Down Expand Up @@ -94,6 +94,8 @@ export function MaybeViewTraceLink({
transactionType={rootTransaction.transaction.type}
environment={nextEnvironment}
latencyAggregationType={latencyAggregationType}
comparisonEnabled={comparisonEnabled}
comparisonType={comparisonType}
>
<EuiButton fill iconType="apmTrace">
{viewFullTraceButtonLabel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface Props {

export function FlyoutTopLevelProperties({ transaction }: Props) {
const {
urlParams: { latencyAggregationType },
urlParams: { latencyAggregationType, comparisonEnabled, comparisonType },
} = useUrlParams();
const { query } = useApmParams('/services/{serviceName}/transactions/view');

Expand Down Expand Up @@ -67,6 +67,8 @@ export function FlyoutTopLevelProperties({ transaction }: Props) {
transactionType={transaction.transaction.type}
environment={nextEnvironment}
latencyAggregationType={latencyAggregationType}
comparisonEnabled={comparisonEnabled}
comparisonType={comparisonType}
>
{transaction.transaction.name}
</TransactionDetailLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ interface Props {

export function StickySpanProperties({ span, transaction }: Props) {
const { query } = useApmParams('/services/{serviceName}/transactions/view');
const { environment, latencyAggregationType } = query;
const {
environment,
latencyAggregationType,
comparisonEnabled,
comparisonType,
} = query;

const trackEvent = useUiTracker();

Expand Down Expand Up @@ -82,6 +87,8 @@ export function StickySpanProperties({ span, transaction }: Props) {
transactionType={transaction.transaction.type}
environment={nextEnvironment}
latencyAggregationType={latencyAggregationType}
comparisonEnabled={comparisonEnabled}
comparisonType={comparisonType}
>
{transaction.transaction.name}
</TransactionDetailLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
TimeRangeComparisonEnum,
TimeRangeComparisonType,
} from '../../../../../common/runtime_types/comparison_type_rt';
import { getComparisonEnabled } from '../../time_comparison/get_comparison_enabled';

interface Props extends APMLinkExtendProps {
serviceName: string;
Expand All @@ -44,12 +45,16 @@ export function TransactionDetailLink({
transactionType,
latencyAggregationType,
environment,
comparisonEnabled = true,
comparisonEnabled,
comparisonType = TimeRangeComparisonEnum.DayBefore,
...rest
}: Props) {
const { urlParams } = useUrlParams();
const { core } = useApmPluginContext();
const defaultComparisonEnabled = getComparisonEnabled({
core,
urlComparisonEnabled: comparisonEnabled,
});
const location = useLocation();
const href = getAPMHref({
basePath: core.http.basePath,
Expand All @@ -59,7 +64,7 @@ export function TransactionDetailLink({
transactionId,
transactionName,
transactionType,
comparisonEnabled,
comparisonEnabled: defaultComparisonEnabled,
comparisonType,
...pickKeys(urlParams as APMQueryParams, ...persistedFilters),
...pickBy({ latencyAggregationType, environment }, identity),
Expand Down

0 comments on commit 7087317

Please sign in to comment.