File tree Expand file tree Collapse file tree
plugins/node/opentelemetry-plugin-koa Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4444 "@opentelemetry/context-async-hooks" : " 0.9.0" ,
4545 "@opentelemetry/node" : " 0.9.0" ,
4646 "@opentelemetry/tracing" : " 0.9.0" ,
47+ "@types/koa" : " ^2.11.3" ,
4748 "@types/mocha" : " 7.0.2" ,
4849 "@types/node" : " 12.12.47" ,
4950 "@types/shimmer" : " 1.0.1" ,
5051 "codecov" : " 3.7.0" ,
5152 "gts" : " 2.0.2" ,
53+ "koa" : " ^2.13.0" ,
5254 "mocha" : " 7.2.0" ,
5355 "nyc" : " 15.1.0" ,
5456 "rimraf" : " 3.0.2" ,
6163 "dependencies" : {
6264 "@opentelemetry/api" : " ^0.9.0" ,
6365 "@opentelemetry/core" : " ^0.9.0" ,
64- "@types/koa" : " ^2.11.3" ,
65- "koa" : " ^2.13.0" ,
6666 "shimmer" : " ^1.2.1"
6767 }
6868}
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export class KoaPlugin extends BasePlugin<typeof koa> {
7777
7878 }
7979
80- private _patchLayer ( oldMiddleware : KoaMiddleware ) {
80+ private _patchLayer ( middlewareLayer : KoaMiddleware ) {
8181 const patchedLayer = ( context : KoaContext , next : koa . Next ) => {
8282 const currentSpan = this . _tracer . getCurrentSpan ( ) ;
8383 if ( ! currentSpan ) {
@@ -94,8 +94,9 @@ export class KoaPlugin extends BasePlugin<typeof koa> {
9494 mwSpan . setAttribute ( AttributeNames . METHOD , context . method ) ;
9595 mwSpan . setAttribute ( AttributeNames . KOA_TYPE , 'middleware' ) ;
9696
97- oldMiddleware ( context , next ) ;
97+ var result = middlewareLayer ( context , next ) ;
9898 mwSpan . end ( ) ;
99+ return result ;
99100
100101 }
101102 return patchedLayer ;
You can’t perform that action at this time.
0 commit comments