getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.87k stars 1.55k forks source link

Node Azure Functions Tracing without Performance is needed #8996

Open thinkocapo opened 1 year ago

thinkocapo commented 1 year ago

Problem Statement

Tracing is broken between frontend JS to Node Azure, 'tracing without performance'.

The js transaction on the frontend has a bunch of quesiton marks '????' to the backend.

The backend transaction does exist.

Node sdk 7.68.0 JS React sdk 7.64.0

Solution Brainstorm

should be the same traceId on both the frontend and backend events. Should not see the '????'. I'm not entirely sure what's needed to fix this.

Miscellaneous Debugging info

Comparing traceId's between the frontend and backend transactions, they're the same...if you remove the postfixed strings at the end.

frontend txn vs backend txn

"6d7d97b8f6284167b89050d56ff8a093"=="6d7d97b8f6284167b89050d56ff8a093"
true

"6d7d97b8f6284167b89050d56ff8a093"=="6d7d97b8f6284167b89050d56ff8a093-8ca96459fa381343-1"
false
thinkocapo commented 1 year ago

@AbhiPrasad the ask is 'tracing without performance' but may I ask this be tested for 'tracing with performance' too? Maybe both techniques rely on the same code fixtures.

If 'Tracing with Performance' doesn't work either then my instinct says it will not work 'without' performance.

"measure twice, cut once"

thinkocapo commented 1 year ago

might relate to this https://github.com/getsentry/sentry-javascript/issues/9011

Lms24 commented 12 months ago

Adding a bit more context to this issue since I just found the slack thread:

The ask is to provide a way to pick up the incoming http request headers (sentry-trace, baggage) and to continue the trace within the wrapper in the azure function. This will be addressed by #9011.

Some extra context:

Currently, this doesn't work in Azure because unlike AWS and GCP we don't expose wrappers for the function handlers that automatically take care of continuing the trace. For Azure, we don't even recommend @sentry/serverles but @sentry/node. So IMO it totally makes sense to strive for the generic continueTrace function instead of providing an Azure specific wrapper. We could fwiw still do this afterwards and just use the continueTrace function internally but this IMO is another issue and out of scope for now.