apm-agent-nodejs: spdy: No active transaction found - cannot build new span

I am trying to set up the agent in my Node app. I am not seeing logs; when I set logLevel to trace, I see these sorts of errors:

(on a route which makes a call to an Elasticsearch instance):

2019-04-03T11:09:15.183Z | INFO | Events GET attempt by 
no active transaction found - cannot build new span
intercepted call to elasticsearch.Transport.prototype.request { id: null, method: 'POST', path: '/sb-app-events-*/_search' }
could not instrument elasticsearch request { id: null }
no active transaction found - cannot build new span

(on a route which makes a call to a MySQL backend):

2019-04-03T11:09:15.180Z | INFO | GET user preferences attempt by 
capturing custom stack trace for knex
shimming knex runner.query
intercepted call to knex runner.query
no active transaction found - cannot build new span
intercepted call to mysql connection.query { id: null }

Expected behavior I’d like to trace transactions with the APM agent.

Environment (please complete the following information)

  • OS: Windows 10
  • Node.js version: 10.14.2
  • APM Server version: 6.4.7
  • Agent version:2.7.1

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

  • Agent config options

Click to expand
const apm = require('elastic-apm-node').start({
    // Set custom APM Server URL (default: http://localhost:8200)
    serverUrl: "http://server-address:8200",
    logLevel: 'trace'
})
  • package.json dependencies:
Click to expand
    "bcrypt": "^3.0.5",
    "blt-http2-router": "^0.5.4404",
    "blt-log": "^0.5.3564",
    "blt-smc-event-types-subtypes": "^0.5.5941",
    "blt-web-utils": "^0.5.3314",
    "body-parser": "^1.18.3",
    "bookshelf": "^0.14.2",
    "bookshelf-json-columns": "^2.1.1",
    "bookshelf-upsert": "^0.2.0",
    "connect-timeout": "^1.9.0",
    "cookie-parser": "~1.4.4",
    "debug": "~4.1.1",
    "dotenv": "^6.2.0",
    "elastic-apm-node": "^2.7.1",
    "elasticsearch": "^15.4.1",
    "express": "^4.16.4",
    "express-fileupload": "latest",
    "express-ipfilter": "^0.3.1",
    "http-errors": "~1.7.2",
    "jwt-simple": "^0.5.5",
    "kafka-streams": "^4.8.0",
    "knex": "^0.16.3",
    "knex-migrate": "^1.7.2",
    "knex-schema-reader": "git+https://git@github.com/mattjcowan/knex-schema-reader.git",
    "lodash": "^4.17.11",
    "moment": "latest",
    "morgan": "^1.9.1",
    "mysql": "^2.16.0",
    "mysql2": "^1.6.5",
    "nock": "^10.0.6",
    "parse-error": "^0.2.0",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0",
    "pug": "2.0.3",
    "query-string": "^6.4.2",
    "request": "^2.88.0",
    "request-ip": "^2.1.3",
    "request-promise-native": "^1.0.7",
    "spdy": "^4.0.0",
    "sqlite": "^3.0.3",
    "uuid4": "^1.1.4",
    "validator": "^10.11.0",
    "winston": "^3.2.1",
    "winston-daily-rotate-file": "^3.8.0"

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

I hope next week - but no promises.

In the meantime, you could use this code here for inspiration on how to add the header manually yourself (this is the code that currently adds it to outgoing HTTP requests):

https://github.com/elastic/apm-agent-nodejs/blob/853c9ddde1ce2d671e3d478e103edeeac5f29539/lib/instrumentation/http-shared.js#L122-L130