reactjsgraphqldatadogdistributed-tracing

How to connect Datadog Rum to traces


I just connected Datadog RUM on my React SPA application, this application is not connected to a backend but uses graphql apis from another application which has Datadog tracing agent set on it

datadogRum.init({
  applicationId: 'xxxxxxxxx',
  clientToken: 'xxxxxxxxxxxxxx',
  site: 'datadoghq.com',
  service: 'order',
  env: 'staging',
  // Specify a version number to identify the deployed version of your application in Datadog
  // version: '1.0.0',
  sampleRate: 100,
  premiumSampleRate: 100,
  trackInteractions: true,
  defaultPrivacyLevel: 'mask-user-input',
  allowedTracingOrigins: [/https:\/\/(?:api|app)\.example\.(?:cc|com)\/graphql/],
})

I already have datadog tracing agent set on. app.example.com which is a monolith Ruby on rails application but also exposes a graphql api

I want to be able to get the graphql calls made from the React frontend to the ROR app on the Datadog RUM traces tab, but with my current setup nothing happens.
on the Datadog docs these are the prerequisite for this to work.

I think I have all those met I am not completely sure, but my question is how do I properly connect Datadog RUM to traces.


Solution

  • I ran in to this issue and had to update my rum npm package, it was too old.