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

Sentry trace header not propagated to requests made from the native layer. #1456

Closed
valeriashpiner opened this issue Apr 19, 2021 · 23 comments
Closed

Comments

@valeriashpiner
Copy link

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
"@sentry/react-native": "^2.4.0",

Steps to Reproduce

  1. I tried to set up Performance monitoring through Included Instrumentation.

  2. I set up Sentry.

Screen Shot 2021-04-19 at 4 03 28 PM

  1. I connected Sentry to Navigatior.

Screen Shot 2021-04-19 at 4 05 53 PM

  1. That's all what I did.

Expected Result

I would like to see sentry-trace in my request headers. None of my request has it right now.
Can you, please, explain what step did I miss.

Actual Result

In Transactions tab in Performance Dashboard I see only screen names which I visit, but I don't see any other transactions (network calls, for example). I don't have sentry-trace headers in any of my network calls.

@fdalmard
Copy link

fdalmard commented May 4, 2021

Same issue here 😐

@jrunkel
Copy link

jrunkel commented May 4, 2021

Here too.

@jennmueng jennmueng self-assigned this May 10, 2021
@jennmueng jennmueng added this to Backlog in Mobile Platform Team Archived via automation May 10, 2021
@jennmueng jennmueng moved this from Backlog to In Progress in Mobile Platform Team Archived May 10, 2021
@jennmueng jennmueng moved this from In Progress to Next in Mobile Platform Team Archived May 10, 2021
@osamaarefm
Copy link

Same here.

@yahuio
Copy link

yahuio commented Jun 11, 2021

Same here

@yahuio
Copy link

yahuio commented Jul 2, 2021

Any update?

@oktorakevinarigi
Copy link

oktorakevinarigi commented Jul 26, 2021

Same here.

Any update?

@jennmueng
Copy link
Member

I just got back from a vacation, I will look into this ASAP

@OleksiyTrofimenko
Copy link

Same issue with latest versions

@Imperyall
Copy link

same here

1 similar comment
@0b3r
Copy link

0b3r commented Sep 9, 2021

same here

@laygir
Copy link

laygir commented Oct 16, 2021

Somewhat same here using vue 2

@marandaneto
Copy link
Contributor

@jennmueng did you have the time to look into it? thanks

@jennmueng
Copy link
Member

How is everyone making the requests that are missing the sentry-trace header? Can I get some examples?

FYI Given the current hybrid SDK limitations the trace header will only be attached to outgoing http requests sent by the javascript layer, and none from the native layer.

@laygir
Copy link

laygir commented Oct 19, 2021

@jennmueng I am on Vue2 but for what its worth, here's my issue:

I make a request using Axios on the beforeEach hook of my router. When VueRouterInstrumentation is enabled, my request starts before the pageload or navigation transaction kicks in, this causes the request to NOT have the trace header.

It took me some time to figure out automatic instrumentation does not pick up individual XHR requests (bummer) unless there is an active transaction. And automatic instrumentation only creates transactions for pageload and navigation as far as I could see so far.

Perhaps documentation could be improved to state these hard facts, because as a dev who started using Sentry tracing just 2 weeks ago, I was under the assumption that every XHR request should have been pick up by the automatic instrumentation.

Also this following Sentry support reply has mislead me on that expectation:

"For the front-end side, the automatic instrumentation should create transaction to every XHR request (as long as the sampling is 100%). If it doesn't, we will need to check the logs after adding the debug option, in order to understand why."

@marandaneto
Copy link
Contributor

@jennmueng did you manage to reproduce this?

@marandaneto marandaneto added this to To Do in kanban via automation Nov 10, 2021
@marandaneto marandaneto moved this from Next to Needs Discussion in Mobile Platform Team Archived Nov 10, 2021
@marandaneto marandaneto moved this from To Do to Needs Discussion in kanban Nov 10, 2021
@philipphofmann philipphofmann removed this from Needs Discussion in Mobile Platform Team Archived Nov 10, 2021
@kaokei
Copy link

kaokei commented Nov 11, 2021

I just met the same problem in a vue3 app. And I think the key problem is that sentry start pageload transaction too late. Now sentry start pageload transaction inside router.beforeEach. The sentry-trace header will miss if I send request before that time.

The picture below shows the timeline.

image

The picture below shows that starting pageload transaction inside router.beforeEach is too late.

image

@jennmueng Is that possible to start pageload transaction earlier?

@laygir
Copy link

laygir commented Nov 11, 2021

Hey @kaokei 👋

I have been in touch with Sentry support and recently concluded a month long e-mail thread precisely about this behaviour.
Also have created the issue below and it's been acknowledged by Sentry and support told me that it is in the backlog and will be fixed soon. I hope they fulfill this promise.

getsentry/sentry-javascript#4072

Feel free to add your additional findings on the above issue.

@marandaneto
Copy link
Contributor

@valeriashpiner can you confirm that you're also using the vue router? thanks

@jennmueng
Copy link
Member

@laygir @kaokei As you guys are using Vue and not React Native, I guess it's not exactly related to this issue with the React Native SDK and rather the discussion should be on the Sentry Javascript repo: getsentry/sentry-javascript#4072. Noting that I have not been able to reproduce this issue along with no one providing reproductions I will assume it is due to creating the request on the native layer side rather on the Javascript side like I earlier hypothesized.

I will thus rename this issue and move it to our Backlog.

@jennmueng jennmueng moved this from Needs Discussion to To Do in kanban Nov 30, 2021
@jennmueng jennmueng changed the title Sentry-trace header is not available in network Request Headers Sentry trace header not propagated to requests made from the native layer. Nov 30, 2021
@marandaneto marandaneto moved this from To Do to In progress in kanban Dec 3, 2021
@marandaneto marandaneto moved this from In progress to Needs Discussion in kanban Dec 6, 2021
@marandaneto marandaneto moved this from Needs Discussion to To Do in kanban Dec 6, 2021
@marandaneto marandaneto moved this from To Do to In progress in kanban Dec 6, 2021
@marandaneto
Copy link
Contributor

@jennmueng I'm a bit lost here, help me out understanding what should be done.

if people are using the vue integration, they might hit getsentry/sentry-javascript#4072, ok, that's a reported bug already.

what do you mean by requests made from the native layer? Native layer = Native SDKs Android and iOS? how did you come to this conclusion? the issue description had no clue about making a request on the Java/ObjC side.

@marandaneto
Copy link
Contributor

@jennmueng mind clarifying? thanks

@marandaneto
Copy link
Contributor

After discussing on a call, the vue issue isn't related to this at all.
The original issue is about syncing down the sentry trace header to the Native layer (Android/iOS).

@marandaneto
Copy link
Contributor

Closed in favor of #2003 and getsentry/sentry-javascript#4072

kanban automation moved this from In progress to Done Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests