Skip to content

Different behavior on Node.js 12.x and Node.js 14.x using knex 0.21.6 #1882

Closed
@qfdk

Description

@qfdk

Describe the bug

Different behavior on Node.js 12.x and Node.js 14.x using knex 0.21.6

It is stated in your documentation that APM supports a minimal version of NodeJS 10.

supported-technologies.

Nevertheless, when using Node.js (v12.16.2) on our environment, we noticed that we had no more span returned for our SQL queries created via the knex driver (v0.21.6).

After some investigations, we decided to upgrade Node.js from v12.16.2 to 14.16.1 and the problem strangely disappeared.

We were indeed able to see the spans back.

We have tested serval combinations by activating debug mode:

Node.js v12.16.2 + knex (0.21.6) : no span sql

Node.js v14.15.1 + knex (0.21.6) : span sql

Expected behavior

Environment (please complete the following information)

  • OS: Linux ubuntu 16.04 / macOS
  • Node.js version: 12.16.2 / 14.15.1
  • APM Server version: 7.9.3
  • Agent version: 3.7.0

How are you starting the agent? (please tick one of the boxes)

  • Calling agent.start() directly (e.g. require('elastic-apm-node').start(...))
  • Requiring elastic-apm-node/start from within the source code
  • Starting node with -r elastic-apm-node/start

Additional context

  • Agent config options

    Click to expand
    serviceName: process.env.APM_SERVICE_NAME,
    containerId: containerId,
    secretToken: process.env.APM_SECRET_TOKEN,
    serverUrl: process.env.APM_SERVER_URL,
    active: true,
    captureSpanStackTraces: false,
    breakdownMetrics: false,
    
  • package.json dependencies:

    Click to expand
    "dependencies": {
       "elastic-apm-node": "3.7.0",
        "axios": "^0.20.0",
        "body-parser": "^1.19.0",
        "compression": "^1.7.4",
        "express": "^4.17.1",
        "helmet": "^4.1.1",
        "knex": "^0.21.1",
        "lodash": "^4.17.15",
        "moment": "^2.24.0",
        "mongoose": "^5.8.10",
        "mssql": "^6.2.0"
    },
    "devDependencies": {
        "@types/compression": "^1.0.1",
        "@types/express": "^4.17.2",
        "@types/helmet": "0.0.48",
        "@types/lodash": "^4.14.161",
        "nodemon": "^2.0.2"
    }    ```
    </details>
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-nodejsMake available for APM Agents project planning.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions