Skip to content

Commit

Permalink
[ProfilingxAPM] Passing selected time range to links (#173160)
Browse files Browse the repository at this point in the history
I forgot to pass the selected time range to the Profiling links in the
APM UI.

Fixing it here.
  • Loading branch information
cauemarcondes authored Dec 12, 2023
1 parent 05bfe53 commit 6443b57
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export function ProfilingOverview() {
environment={environment}
dataSource={preferred?.source}
kuery={kuery}
rangeFrom={rangeFrom}
rangeTo={rangeTo}
/>
</>
),
Expand All @@ -99,12 +101,23 @@ export function ProfilingOverview() {
endIndex={10}
dataSource={preferred?.source}
kuery={kuery}
rangeFrom={rangeFrom}
rangeTo={rangeTo}
/>
</>
),
},
];
}, [end, environment, kuery, preferred?.source, serviceName, start]);
}, [
end,
environment,
kuery,
preferred?.source,
rangeFrom,
rangeTo,
serviceName,
start,
]);

if (isLoading) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ interface Props {
ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent
>;
kuery: string;
rangeFrom: string;
rangeTo: string;
}

export function ProfilingFlamegraph({
Expand All @@ -49,6 +51,8 @@ export function ProfilingFlamegraph({
environment,
dataSource,
kuery,
rangeFrom,
rangeTo,
}: Props) {
const { profilingLocators } = useProfilingPlugin();

Expand Down Expand Up @@ -93,6 +97,8 @@ export function ProfilingFlamegraph({
data-test-subj="apmProfilingFlamegraphGoToFlamegraphLink"
href={profilingLocators?.flamegraphLocator.getRedirectUrl({
kuery: mergeKueries([`(${hostNamesKueryFormat})`, kuery]),
rangeFrom,
rangeTo,
})}
>
{i18n.translate('xpack.apm.profiling.flamegraph.link', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ interface Props {
ApmDocumentType.TransactionMetric | ApmDocumentType.TransactionEvent
>;
kuery: string;
rangeFrom: string;
rangeTo: string;
}

export function ProfilingTopNFunctions({
Expand All @@ -42,6 +44,8 @@ export function ProfilingTopNFunctions({
endIndex,
dataSource,
kuery,
rangeFrom,
rangeTo,
}: Props) {
const { profilingLocators } = useProfilingPlugin();

Expand Down Expand Up @@ -97,6 +101,8 @@ export function ProfilingTopNFunctions({
data-test-subj="apmProfilingTopNFunctionsGoToUniversalProfilingFlamegraphLink"
href={profilingLocators?.topNFunctionsLocator.getRedirectUrl({
kuery: mergeKueries([`(${hostNamesKueryFormat})`, kuery]),
rangeFrom,
rangeTo,
})}
>
{i18n.translate('xpack.apm.profiling.topnFunctions.link', {
Expand Down

0 comments on commit 6443b57

Please sign in to comment.