Skip to content

request method of other library is picked up by http instrumentation #1782

@janpio

Description

@janpio

During #1781 I also stumbled over the following behavior:

When wrapping a function called request the http instrumentation seems to get triggered:

var originalRequest = prisma.fetcher.request
var newRequest = async function(object) {
  var span = apm.startSpan('Query Engine (prisma.fetcher.request)')
  var result = await originalRequest.call(this, object)
  span.end()
  return result
}
prisma.fetcher.request = newRequest

leads to this debug output:

no active transaction found - cannot build new span
intercepted call to http.request { id: null }

and quite some confusion.

The workaround or solution is to configure the instrumentation to ignore http: disableInstrumentations: ['http'] in apm.start().

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-nodejsMake available for APM Agents project planning.bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions