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

VisionPro / iOS can't use trace #4470

Open
koi646 opened this issue Oct 24, 2024 · 10 comments
Open

VisionPro / iOS can't use trace #4470

koi646 opened this issue Oct 24, 2024 · 10 comments

Comments

@koi646
Copy link

koi646 commented Oct 24, 2024

Platform

visionOS

Environment

Develop

Installed

Swift Package Manager

Version

8.38

Xcode Version

16.0

Did it work on previous versions?

No response

Steps to Reproduce

  1. install sentry-cocoa
        SentrySDK.start { options in
            options.dsn = "xxx"
            options.debug = false // Enabling debug when first installing is always helpful
            options.tracesSampleRate = 1.0
            options.environment = "dev"
        }
  1. sent request to nodejs server(nodejs server use sentry too)

Expected Result

visionpro -> nodejs trace work fine

Actual Result

visionPro and nodejs can't show trace info, i print http headers
Image

when i remove visionPro sentry, nodejs trace can show

Are you willing to submit a PR?

No response

@philipphofmann
Copy link
Member

@koi646, does this work for you on any other Apple platform? Is it only not working on visionOS?

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Oct 30, 2024
@brustolin brustolin moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Oct 30, 2024
@brustolin brustolin moved this from Needs Investigation to Needs More Information in Mobile & Cross Platform SDK Oct 30, 2024
@koi646
Copy link
Author

koi646 commented Nov 20, 2024

@koi646, does this work for you on any other Apple platform? Is it only not working on visionOS?

I tried many methods and found that trace does not work on iOS and Vision Pro versions. My backend is Node.js, and I am using the Sentry SDK for the NestJS framework. However, when I switched the front end to a web platform reporting to the same backend interface, I found that trace works properly. This confuses me.

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 20, 2024
@koi646
Copy link
Author

koi646 commented Nov 20, 2024

I noticed that the baggag value in the headers is different.
This is the baggag value for a normal trace:
Image

fail trace:
Image

Here is my Sentry configuration by swift
Image

@koi646
Copy link
Author

koi646 commented Nov 20, 2024

@koi646, does this work for you on any other Apple platform? Is it only not working on visionOS?

@philipphofmann Currently, if I configure trace reporting for iOS/visionOS, I cannot see my backend request logs in the Sentry dashboard. However, if I intentionally set an unrelated options.tracePropagationTargets (non-API domain), the baggage value on the iOS side becomes empty, and I can see the backend request logs again.

@koi646
Copy link
Author

koi646 commented Nov 20, 2024

By the way, I've now switched to version 8.40.1, using the static library.

@koi646 koi646 changed the title VisionPro can't use trace VisionPro / IOS can't use trace Nov 20, 2024
@philipphofmann
Copy link
Member

In #4470 (comment) you wrote about a normal trace and a fail trace. I need more clarification what these are.

if I intentionally set an unrelated options.tracePropagationTargets (non-API domain), the baggage value on the iOS side becomes empty, and I can see the backend request logs again.

That could mean that something with the baggage is not working correctly either on our SDK or the backend SDKs. What exactly do you mean by unrelated options.tracePropagationTargets (non-API domain)? Do you mean you set it to something that's not your domain to which your app sends the requests to?

@koi646
Copy link
Author

koi646 commented Nov 21, 2024

In #4470 (comment) you wrote about a normal trace and a fail trace. I need more clarification what these are.

if I intentionally set an unrelated options.tracePropagationTargets (non-API domain), the baggage value on the iOS side becomes empty, and I can see the backend request logs again.

That could mean that something with the baggage is not working correctly either on our SDK or the backend SDKs. What exactly do you mean by unrelated options.tracePropagationTargets (non-API domain)? Do you mean you set it to something that's not your domain to which your app sends the requests to?

Sorry for my unclear explanation, let me organize my explanation.

  1. My backend is based on NestJS and has integrated the Sentry NestJS SDK.

  2. "Normal trace" refers to requests initiated by the browser when my frontend is web-based, and the trace functions normally at this time.

  3. "Fail trace" refers to requests initiated after integrating the Sentry iOS SDK, during which the trace does not work

  4. Both the web and iOS sides are requesting the same backend interface.

  5. After integrating the Sentry SDK in Swift, not only are the Swift network reports missing from the dashboard, but the previously existing Sentry transaction records for Node.js have also disappeared.

  6. While trying to locate the bug, I set "options.tracePropagationTargets=[]" on the iOS side. This means the request headers won't include baggage. Although there's no reporting from the iOS side, the Node.js Sentry transaction records have been restored.

The same backend interface should not have different behaviors with SDKs from different front-end platforms(web,iOS), I suspect that the issue is related to the ”baggage“.

These are the 【3】 missing Node.js Sentry transaction records.
Image

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Nov 21, 2024
@koi646 koi646 changed the title VisionPro / IOS can't use trace VisionPro / iOS can't use trace Nov 21, 2024
@philipphofmann
Copy link
Member

philipphofmann commented Nov 21, 2024

The same backend interface should not have different behaviors with SDKs from different front-end platforms(web,iOS), I suspect that the issue is related to the ”baggage“.

Yes, indeed. Can you please try if you experience the issue as well with 8.36.0? That's a release for which I know for sure it's working for our internal demoing purposes.

Just for clarification, are the iOS transactions working fine? Only the trace linking is broken?

@koi646 koi646 closed this as completed Nov 22, 2024
@github-project-automation github-project-automation bot moved this from Needs More Information to Done in Mobile & Cross Platform SDK Nov 22, 2024
@koi646
Copy link
Author

koi646 commented Nov 22, 2024

The same backend interface should not have different behaviors with SDKs from different front-end platforms(web,iOS), I suspect that the issue is related to the ”baggage“.

Yes, indeed. Can you please try if you experience the issue as well with 8.36.0? That's a release for which I know for sure it's working for our internal demoing purposes.

Just for clarification, are the iOS transactions working fine? Only the trace linking is broken?

Tried version 8.36.0 as well, and the issue persists. The iOS network trace cannot be displayed on the dashboard, but if transactions are created manually, they work properly. I can reproduce this with a minimal iOS and NestJS example. Do you need me to create a reproducible code repository?

(Sorry, I clicked the wrong button, which caused this issue to be closed.😓

@brustolin brustolin reopened this Nov 22, 2024
@brustolin
Copy link
Contributor

Do you need me to create a reproducible code repository?

This would be perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

3 participants