GetDutchie / datadog_flutter

**This community package has been deprecated in favor of Datadog's official SDK**
https://github.com/DataDog/dd-sdk-flutter
MIT License
24 stars 24 forks source link

No rum data uploaded - "(rum) No upload" #75

Closed opsb closed 2 years ago

opsb commented 2 years ago

I've had the logging working for a while but decided to add RUM for error tracking. No matter what I try though I always get the message (rum) No upload.

  await DatadogFlutter.initialize(
    trackingConsent: TrackingConsent.granted,
    clientToken: const String.fromEnvironment("DD_TOKEN"),
    iosRumApplicationId:
        const String.fromEnvironment("DD_IOS_RUM_APPLICATION_ID"),
    serviceName: 'app-name',
    environment: "production",
    useEUEndpoints: true,
  );
  await DatadogFlutter.setUserInfo(id: "anon1");
  await DatadogRum.instance.addUserAction("hello");

Am I correct in thinking that the above should cause the user action to be sent with the next RUM data batch upload? (DD_TOKEN is my main client_token, I also tried the rum app client_token which again worked for logging but not RUM). Maybe I'm missing a step?

tshedor commented 2 years ago

Hey @opsb are you using DatadogObserver? RUM data sometimes doesn't upload if an active screen isn't set.

tshedor commented 2 years ago

And by sometimes I mean "maybe always?"

opsb commented 2 years ago

Hey @tshedor I'm not using the DatadogObserver at all actually, mainly because I don't use the MaterialApp navigation. Looks like I could get it working by just calling

await DatadogRum.instance.stopView(previousRouteName);
await DatadogRum.instance.startView(routeName);

I'll give it a go, thanks for the pointer!