diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx index 9b8706fe11035..6751e76cfa335 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_throughput_chart.tsx @@ -37,10 +37,12 @@ export function ServiceOverviewThroughputChart({ height, environment, kuery, + transactionName, }: { height?: number; environment: string; kuery: string; + transactionName?: string; }) { const theme = useTheme(); @@ -80,6 +82,7 @@ export function ServiceOverviewThroughputChart({ transactionType, comparisonStart, comparisonEnd, + transactionName, }, }, }); @@ -94,6 +97,7 @@ export function ServiceOverviewThroughputChart({ transactionType, comparisonStart, comparisonEnd, + transactionName, ] ); diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx index c4ecc71941b8c..9da1ee25246dd 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/index.tsx @@ -50,6 +50,7 @@ export function TransactionDetails() { environment={query.environment} start={start} end={end} + transactionName={transactionName} /> diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx index 6e2ed04776e1c..4fdce0dfa705e 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_charts/index.tsx @@ -19,11 +19,13 @@ export function TransactionCharts({ environment, start, end, + transactionName, }: { kuery: string; environment: string; start: string; end: string; + transactionName?: string; }) { return ( <> @@ -44,6 +46,7 @@ export function TransactionCharts({ diff --git a/x-pack/plugins/apm/server/lib/services/get_throughput.ts b/x-pack/plugins/apm/server/lib/services/get_throughput.ts index e866918fc29bb..76d6000a161e6 100644 --- a/x-pack/plugins/apm/server/lib/services/get_throughput.ts +++ b/x-pack/plugins/apm/server/lib/services/get_throughput.ts @@ -8,6 +8,7 @@ import { ESFilter } from '../../../../../../src/core/types/elasticsearch'; import { SERVICE_NAME, + TRANSACTION_NAME, TRANSACTION_TYPE, } from '../../../common/elasticsearch_fieldnames'; import { kqlQuery, rangeQuery } from '../../../../observability/server'; @@ -25,6 +26,7 @@ interface Options { serviceName: string; setup: Setup; transactionType: string; + transactionName?: string; start: number; end: number; intervalString: string; @@ -38,6 +40,7 @@ export async function getThroughput({ serviceName, setup, transactionType, + transactionName, start, end, intervalString, @@ -56,6 +59,14 @@ export async function getThroughput({ ...kqlQuery(kuery), ]; + if (transactionName) { + filter.push({ + term: { + [TRANSACTION_NAME]: transactionName, + }, + }); + } + const params = { apm: { events: [ diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts index 32a7dcefb5cc8..550781cc1a020 100644 --- a/x-pack/plugins/apm/server/routes/services.ts +++ b/x-pack/plugins/apm/server/routes/services.ts @@ -451,10 +451,8 @@ const serviceThroughputRoute = createApmServerRoute({ }), query: t.intersection([ t.type({ transactionType: t.string }), - environmentRt, - kueryRt, - rangeRt, - comparisonRangeRt, + t.partial({ transactionName: t.string }), + t.intersection([environmentRt, kueryRt, rangeRt, comparisonRangeRt]), ]), }), options: { tags: ['access:apm'] }, @@ -466,6 +464,7 @@ const serviceThroughputRoute = createApmServerRoute({ environment, kuery, transactionType, + transactionName, comparisonStart, comparisonEnd, } = params.query; @@ -493,6 +492,7 @@ const serviceThroughputRoute = createApmServerRoute({ serviceName, setup, transactionType, + transactionName, throughputUnit, intervalString, };