File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
src/optimize/bundles_route
x-pack/plugins/task_manager/server/task_running Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { extname, join } from 'path';
1010
1111import Hapi from '@hapi/hapi' ;
1212import * as UiSharedDeps from '@kbn/ui-shared-deps' ;
13+ import agent from 'elastic-apm-node' ;
1314
1415import { createDynamicAssetResponse } from './dynamic_asset_response' ;
1516import { FileHashCache } from './file_hash_cache' ;
@@ -101,6 +102,8 @@ function buildRouteForBundles({
101102 method ( request : Hapi . Request , h : Hapi . ResponseToolkit ) {
102103 const ext = extname ( request . params . path ) ;
103104
105+ agent . setTransactionName ( 'GET ?/bundles/?' ) ;
106+
104107 if ( ext !== '.js' && ext !== '.css' ) {
105108 return h . continue ;
106109 }
Original file line number Diff line number Diff line change @@ -201,10 +201,10 @@ export class TaskManagerRunner implements TaskRunner {
201201 } ) ;
202202
203203 const stopTaskTimer = startTaskTimer ( ) ;
204- const apmTrans = apm . startTransaction (
205- `taskManager run ${ this . instance . taskType } ` ,
206- 'taskManager'
207- ) ;
204+ const apmTrans = apm . startTransaction ( `taskManager run` , 'taskManager' ) ;
205+ apmTrans ?. addLabels ( {
206+ taskType : this . taskType ,
207+ } ) ;
208208 try {
209209 this . task = this . definition . createTaskRunner ( modifiedContext ) ;
210210 const result = await this . task . run ( ) ;
@@ -232,10 +232,11 @@ export class TaskManagerRunner implements TaskRunner {
232232 public async markTaskAsRunning ( ) : Promise < boolean > {
233233 performance . mark ( 'markTaskAsRunning_start' ) ;
234234
235- const apmTrans = apm . startTransaction (
236- `taskManager markTaskAsRunning ${ this . instance . taskType } ` ,
237- 'taskManager'
238- ) ;
235+ const apmTrans = apm . startTransaction ( `taskManager markTaskAsRunning` , 'taskManager' ) ;
236+
237+ apmTrans ?. addLabels ( {
238+ taskType : this . taskType ,
239+ } ) ;
239240
240241 const now = new Date ( ) ;
241242 try {
You can’t perform that action at this time.
0 commit comments