DB2 spans for Node Js application

Hi,

Nodejs apm agent doesn't show the database query in spans. Database we use is db2 and connect using ibm-db2 dependency for nodejs. Can anyone suggest if any specific flags need to be passed to intialise database query spans?

Hi @satpreetsn.

Are you using this npm package: ibm_db - npm ?
The Node.js APM agent doesn't currently have an instrumentation for the ibm_db package, so it expected that it isn't automatically picking up DB query details.

Are you manually starting APM spans (via apm.startSpan(...) or similar)? If so, and if you have access to the database query statement, then you can use something like:

var span = apm.startSpan(...)
span.setDbContext({type: 'db2', statement: '... query statement here ...'})

Note, however, that span.setDbContext() is an internal/undocumented method that can change.

I see ibm_db driver uses underlying ODBC drivers. Can we have any instrumentation for ODBC drivers?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.