Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect (native) resource type with (Xhr) resource type for the same call #1296

Open
SandraGeorge19 opened this issue May 31, 2023 · 2 comments
Assignees
Labels
compilation issue SDK doesn't compile or gives warnings.

Comments

@SandraGeorge19
Copy link

Thanks for taking the time for reporting an issue!

The issue

we need to link the traces with the resources that we sent as shown in the screens the traces is sent empty so we did a work around to send the traces in a native resource type in session obj using "Global.rum.startResourceLoading" method but we need a way to link them together or send traces with resources.

Steps to reproduce the issue:
start resource and send custom attributes with it using "Global.rum.startResourceLoading" method and then stop resources using "stopResourceLoading" method with the same attributes

Screenshot 2023-05-31 at 4 26 54 PM

Attributes are sent normally but the Traces for that call not sent

Screenshot 2023-05-31 at 4 26 37 PM

Datadog SDK version:

'DatadogSDK', '1.8.0'

Last working Datadog SDK version:

'DatadogSDK', '1.8.0'

Dependency Manager:

Cocoapods

Xcode version:

Xcode 14.2 (14C18)

Swift version:

5.0

Deployment Target:

iOS 12

macOS version:

macOS Ventura 13.2.1

@SandraGeorge19
Copy link
Author

@ganeshnj
any updates?

@ganeshnj
Copy link
Contributor

ganeshnj commented Jun 5, 2023

Hi Sandra,

I was able to reproduce the issue using

let url = URL(string: "https://httpbin.org/get")!
let key = "httpbin/get"
Global.rum.startResourceLoading(resourceKey: key, url: url)
let span = Global.sharedTracer.startSpan(operationName: "get")
let task = URLSession.shared.dataTask(with: url) { data, response, error in
    print("Response: \(String(describing: response))")
    if let response = response {
        Global.rum.stopResourceLoading(resourceKey: key, response: response)
    } else if let error = error {
        Global.rum.stopResourceLoadingWithError(resourceKey: key, error: error)
    } else {
        Global.rum.stopResourceLoadingWithError(resourceKey: key, errorMessage: "idk", response: nil)
    }
    span.finish()
}
task.resume()

We are investigating and will update soon. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation issue SDK doesn't compile or gives warnings.
Projects
None yet
Development

No branches or pull requests

2 participants