diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx index fd31035962b6e..9bfff6a4ea89b 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx @@ -280,12 +280,17 @@ function RelatedErrors({ '/traces/explorer' ); + let kuery = `${TRACE_ID} : "${item.doc.trace.id}"`; + if (item.doc.transaction?.id) { + kuery += ` and ${TRANSACTION_ID} : "${item.doc.transaction?.id}"`; + } + const href = apmRouter.link(`/services/{serviceName}/errors`, { path: { serviceName: item.doc.service.name }, query: { ...query, serviceGroup: '', - kuery: `${TRACE_ID} : "${item.doc.trace.id}" and ${TRANSACTION_ID} : "${item.doc.transaction?.id}"`, + kuery, }, });