Skip to content

Knex database spans not recorded when using async/await #873

Open
@thrcorrea

Description

@thrcorrea

Describe the bug
When a define a route wich uses knex to connect do the database, and use async await at the function definition, the apm agent does not send the sql span, not showing the sql info at the request timeline at kibana. The apm agent does not support async/await

To Reproduce
Steps to reproduce the behavior:

  1. Use this config '...'
  2. Then call '....'
  3. Then do '....'
  4. See error

Expected behavior
To show the sql span at the request timeline.

Environment (please complete the following information)

  • OS: Linux
  • Node.js version: v11.10.0
  • APM Server version: 6.6.1
  • Agent version: 2.5.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

Additional context
Add any other context about the problem here.

  • Agent config options

    Click to expand
    serviceName: 'service',
    
  • package.json dependencies:

    Click to expand
    "elastic-apm-node": "^2.5.1",
    "express": "^4.16.4",
    "knex": "^0.16.3",
    "mysql2": "^1.6.5"
    

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions