fix(medusa): Replace default http tracer (#9390)

This commit is contained in:
Adrien de Peretti
2024-09-30 21:17:30 +02:00
committed by GitHub
parent 570c1803f2
commit 9b6d0e9d56
3 changed files with 36 additions and 60 deletions

View File

@@ -180,7 +180,7 @@ function getBodyParserMiddleware(args?: ParserConfigArgs) {
// TODO this router would need a proper rework, but it is out of scope right now
class ApiRoutesLoader {
export class ApiRoutesLoader {
/**
* Map of router path and its descriptor
* @private
@@ -910,27 +910,6 @@ export class RoutesLoader {
*/
readonly #sourceDir: string | string[]
static instrument: {
/**
* Instrument middleware function calls by wrapping the original
* middleware handler inside a custom implementation
*/
middleware: (callback: (typeof ApiRoutesLoader)["traceMiddleware"]) => void
/**
* Instrument route handler function calls by wrapping the original
* middleware handler inside a custom implementation
*/
route: (callback: (typeof ApiRoutesLoader)["traceRoute"]) => void
} = {
middleware(callback) {
ApiRoutesLoader.traceMiddleware = callback
},
route(callback) {
ApiRoutesLoader.traceRoute = callback
},
}
constructor({
app,
activityId,