DataDog / dd-sdk-reactnative

Datadog SDK for ReactNative
Apache License 2.0
115 stars 41 forks source link

EAS Build fails with Expo SDK 46 #304

Closed erisvaldojunior closed 1 year ago

erisvaldojunior commented 1 year ago

Describe what happened

After installing it, following the Expo instructions and running eas build, I get:

✖ Config sync failed SyntaxError: [ios.entitlements]: withIosEntitlementsBaseMod: Expected "/*" or ";" but "e" found.

Steps to reproduce the issue:

eas build -p ios --profile development

Describe what you expected:

EAS Build should complete properly.

Additional context

louiszawadzki commented 1 year ago

Hi @erisvaldojunior, thanks for reaching out!

As per our documentation you should use expo-datadog version 46.0.0 if you use expo version 46.

Some native changes happened between expo 45 and 46 and so expo-datadog 45 is not working with expo 46.

erisvaldojunior commented 1 year ago

@louiszawadzki thank you, doing yarn add expo-datadog again brought me 46.0.0 and this fixed the build.

But RUM dashboard seems not to be tracking events yet, not sure why because initialization log seems fine. I'm using the snippet on React Native section inside the Dashboard -> RUM Applications -> Edit Application, including client token and application id values. Any thoughts?

const initialize = async (env: Environment) => {
  const config = new Datadog.DdSdkReactNativeConfiguration(
    <clientToken>,
    <env>,
    <applicationId>,
    true, // track user interactions such as tapping on a button. You can use the 'accessibilityLabel' element property to give the tap action a name, otherwise the element type is reported.
    true, // track XHR resources.
    true // track errors.
  );
  // Optional: Select your Datadog website ("US1", "US3", "US5", EU1", or "US1_FED"). Default is "US1".
  config.site = "US";
  // Optional: Enable or disable native crash reports.
  config.nativeCrashReportEnabled = true;
  // Optional: Sample RUM sessions, for example: 80% of sessions are sent to Datadog. Default is 100%.
  config.sessionSamplingRate = 100;
  // Optional: Sample tracing integrations for network calls between your app and your backend, for example: 80% of calls to your instrumented backend are linked from the RUM view to the APM view. Default is 20%.
  // You need to specify the hosts of your backends to enable tracing with these backends.
  config.resourceTracingSamplingRate = 100;
  config.firstPartyHosts = ["curebase.com"]; // Matches 'example.com' and subdomains like 'api.example.com'.
  // Optional: Let the Datadog SDK print internal logs above or equal to the provided level. Default is undefined, which means no logs.
  config.verbosity = Datadog.SdkVerbosity.DEBUG;

  await Datadog.DdSdkReactNative.initialize(config);
};
erisvaldojunior commented 1 year ago

Some additional notes:

  1. My dashboard seems to be on US5, but changing from US to US5 didn't make any difference;
  2. I have more than one client token, for web project and mobile, changing them does not make a difference;
  3. I am testing on iOS SImulator using Expo Custom Dev Client, in case it changes something;
  4. Using Debug verbosity I can see some 404, but doesn't seem related to this:

INFO DATADOG: Datadog SDK was initialized INFO DATADOG: Datadog SDK is tracking interactions INFO DATADOG: Datadog SDK is tracking XHR resources INFO DATADOG: Datadog SDK is tracking errors DEBUG DATADOG: Tracking info log “Datadog initialized” INFO Received settings from Segment succesfully. DEBUG DATADOG: Starting RUM View “Test View” #test INFO TRACK (Application Opened) event saved {"event": "Application Opened", "properties": {"build": "20000", "from_background": false, "version": "2.0.0"}, "type": "track"} INFO SCREEN event saved {"name": "login", "properties": {}, "type": "screen"} WARN Possible Unhandled Promise Rejection (id: 0): Error: SDK has not been configured WARN Possible Unhandled Promise Rejection (id: 1): Error: SDK has not been configured DEBUG DATADOG: Starting RUM Resource #1665501379042/POST POST: http://192.168.0.8:8081/symbolicate DEBUG DATADOG: Starting RUM Resource #1665501379046/POST POST: http://192.168.0.8:8081/symbolicate DEBUG DATADOG: Stopping RUM Resource #1665501379042/POST status:200 DEBUG DATADOG: Stopping RUM Resource #1665501379046/POST status:200 DEBUG DATADOG: Starting RUM Resource #1665501379054/POST POST: http://192.168.0.8:8081/symbolicate DEBUG DATADOG: Stopping RUM Resource #1665501379054/POST status:200 DEBUG DATADOG: Starting RUM Resource #1665501379058/POST POST: http://192.168.0.8:8081/symbolicate DEBUG DATADOG: Stopping RUM Resource #1665501379058/POST status:200 DEBUG DATADOG: Starting RUM Resource #1665501379059/POST POST: http://192.168.0.8:8081/symbolicate DEBUG DATADOG: Stopping RUM Resource #1665501379059/POST status:200 DEBUG DATADOG: Starting RUM Resource #1665501379264/GET GET: http://192.168.0.8:8081//Users/erisvaldojunior/Developer/mobile-app/src/services/launchDarkly/index.ts DEBUG DATADOG: Starting RUM Resource #1665501379264/GET GET: http://192.168.0.8:8081//Users/erisvaldojunior/Developer/mobile-app/src/services/launchDarkly/index.ts DEBUG DATADOG: Starting RUM Resource #1665501379265/GET GET: http://192.168.0.8:8081//Users/erisvaldojunior/Developer/mobile-app/src/services/index.ts DEBUG DATADOG: Stopping RUM Resource #1665501379264/GET status:404 DEBUG DATADOG: Starting RUM Resource #1665501379316/GET GET: http://192.168.0.8:8081//Users/erisvaldojunior/Developer/mobile-app/src/services/launchDarkly/provider.tsx DEBUG DATADOG: Stopping RUM Resource #1665501379264/GET status:404 DEBUG DATADOG: Stopping RUM Resource #1665501379265/GET status:404 DEBUG DATADOG: Stopping RUM Resource #1665501379316/GET status:404

louiszawadzki commented 1 year ago

Hi @erisvaldojunior,

You should be using US5 if your dashboard is on US5.

You can have a look at the native iOS log to see if any error shows up at this level. To do so:

You can filter logs by “DATADOG” and look for any error. If you are indeed sending events, you should see the following logs:

[DATADOG SDK] 🐶 → 10:02:47.398 [DEBUG] ⏳ (rum) Uploading batch...
[DATADOG SDK] 🐶 → 10:02:47.538 [DEBUG]    → (rum) accepted, won't be retransmitted: [response code: 202 (accepted), request ID: 2848FE2E-345D-4D8B-82D2-E325CC29B634]

The first one indicates that some data is being sent, the second one that the data has been received

If you see the log below, it means that you have called a RUM method before initialising the SDK, which result in further rum events not being sent.

[DATADOG SDK] 🐶 → 10:09:13.621 [WARN] The `Global.rum` was called but no `RUMMonitor` is registered. Configure and register the RUM Monitor globally before invoking the feature:

Once you have this information, can you reach out to our support team, mentioning this issue? It will make it easier to exchange information and get help from other teams at Datadog.

Thanks a lot!

louiszawadzki commented 1 year ago

Hi,

Since there was no update to this issue for a while I'm considering it resolved and will close it. Feel free to reopen it if it wasn't resolved :)