Skip to content

Commit

Permalink
Always use ProcessorEvent.metric and fix router link in backend popover
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Aug 4, 2021
1 parent 218f3fd commit fa5fdbd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
import { StatsList } from './stats_list';

export function BackendContents({ nodeData }: ContentsProps) {
const { query } = useApmParams('/service-map');
const { query } = useApmParams('*/service-map/*');
const apmRouter = useApmRouter();
const {
urlParams: { environment, start, end },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SPAN_DESTINATION_SERVICE_RESPONSE_TIME_SUM,
} from '../../../common/elasticsearch_fieldnames';
import { EventOutcome } from '../../../common/event_outcome';
import { ProcessorEvent } from '../../../common/processor_event';
import { environmentQuery } from '../../../common/utils/environment_query';
import { withApmSpan } from '../../utils/with_apm_span';
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
Expand All @@ -23,14 +24,12 @@ interface Options {
setup: Setup & SetupTimeRange;
environment?: string;
backendName: string;
searchAggregatedTransactions: boolean;
}

export function getServiceMapBackendNodeInfo({
environment,
backendName,
setup,
searchAggregatedTransactions,
}: Options) {
return withApmSpan('get_service_map_backend_node_stats', async () => {
const { apmEventClient, start, end } = setup;
Expand All @@ -39,11 +38,7 @@ export function getServiceMapBackendNodeInfo({
'get_service_map_backend_node_stats',
{
apm: {
events: [
getProcessorEventForAggregatedTransactions(
searchAggregatedTransactions
),
],
events: [ProcessorEvent.metric],
},
body: {
size: 0,
Expand Down
5 changes: 0 additions & 5 deletions x-pack/plugins/apm/server/routes/service_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,10 @@ const serviceMapBackendNodeRoute = createApmServerRoute({
query: { environment },
} = params;

const searchAggregatedTransactions = await getSearchAggregatedTransactions(
setup
);

return getServiceMapBackendNodeInfo({
environment,
setup,
backendName,
searchAggregatedTransactions,
});
},
});
Expand Down

0 comments on commit fa5fdbd

Please sign in to comment.