Skip to content

currentTransaction.startSpan return null when I use express. #1790

@yunnysunny

Description

@yunnysunny

Describe the bug

const currentTransaction = apm.currentTransaction;
const span = currentTransaction.startSpan(name);

I use the code above in express context, but the span is null.

Environment (please complete the following information)

  • OS: [e.g. Linux] win10
  • Node.js version: 12.18.1
  • APM Server version:3.6.1
  • Agent version: 6.3.2

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

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