Skip to content

[node] Distributed Tracing not working on Express server running Apollo Federation #8314

Closed
@serglom21

Description

@serglom21

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.54.0

Framework Version

No response

Link to Sentry event

https://sergios-test-org.sentry.io/performance/graphql-backend:11412188f8714bef8f38ee9c39ebcdf5/?project=4505321195241472&query=http.method%3APOST&referrer=performance-transaction-summary&statsPeriod=14d&transaction=POST+%2Fgraphql&unselectedSeries=p100%28%29

SDK Setup

Sentry.init({
    dsn: "{DSN}",
    integrations: [
      new Sentry.Integrations.Http({ tracing: true }),
      new Sentry.Integrations.Undici(),
      new Sentry.Integrations.Express({ app }),
      new Sentry.Integrations.Apollo(),
      new Sentry.Integrations.GraphQL()
    ],
    tracesSampleRate: 1.0,
})

Steps to Reproduce

  1. Clone https://github.com/sergiosentry/apollo-graphql-sentry
  2. Follow README to install package dependencies and run services

Expected Result

I expect the trace to be propagated from the gateway service to the accounts service via the /graphql request

These services should then be linked in Sentry with the same trace.

There is a request made to localhost:4001/ that was not traced correctly to that downstream service

Screenshot 2023-06-12 at 10 49 54 AM

Actual Result

The trace is not propagated to the downstream service (accounts/index.js)

It seems that we are not generating spans after the request is initialized and redirected to the GraphQL service.

Metadata

Metadata

Assignees

Labels

Package: nodeIssues related to the Sentry Node SDK

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions