Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
8.116.0
Framework Version
React SadK 8.116.0
Link to Sentry event
Reproduction Example/SDK Setup
Sentry Instrument.js file - we have added the sentry Intialization
Sentry.init({
dsn: "https://[email protected]/450888",
debug:true,
integrations: [
// See docs for support of different versions of variation of react router
// https://docs.sentry.io/platforms/javascript/guides/react/configuration/integrations/react-router/
Sentry.reactRouterV6BrowserTracingIntegration({
useEffect,
useLocation,
useNavigationType,
createRoutesFromChildren,
matchRoutes,
}),
Sentry.replayIntegration(),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
tracesSampleRate: 1.0,
// Set tracePropagationTargets to control for which URLs trace propagation should be enabled
tracePropagationTargets: [/^\//, /^https:\/\/localhost\/api/],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
Steps to Reproduce
-
Custom Instrumentation: We are looking for custom instrumentation to determine the htp request, UI thread and others request in a single group of spans/transaction
In Version7.XX> this feature was available using startTransaction and end the transaction anywhere after custom logic of code -
In Newer version. - With startSpan, startSpanManual, or startInActiveSpan() - all these are starting the span correctly, and ending in callback - working fine,
Requirment:
We dont want to close the span immediately after callback end. To be precise, we want to have any callback as well.
Example: start the user journey span at one component
lets says Component 1 - startSpan()
But performing few actives - like filling a form of 4-5 components
Want to close this span and need to have the entire user journey - HTTP request, UI, component timing, loading images resources script ,etc loading
Closing can be at component 5 .
This we are not able to achieve as callback cannot be single-line. startIdelSpan() - this is also not working.
StartInActiveSpa ()- this works fine but do not capture any http request, resources script etc.
Componet1:
const handleAddLabelClick = () => {
console.log("handleAddLabelClick, start sentry transaction");
captureSentryObservabilityStart();
};
Component 5:
const handleSave = async () => {
// Handle Save sentry closed
captureSentryObservabilityEnd();
};
captureSentryObservabilityStart = () => {
Sentry.continueTrace({ sentryTrace: '', baggage: '' }, function (){
return Sentry.withActiveSpan(null,function(){
parentMenuClicked = Sentry.startInactiveSpan({
op: "menuclicked",
name: entityName,
attributes: {
entityName: entityName
},
forceTransaction: true,
});
});
}
captureSentryObservabilityEnd = () => {
Sentry.withActiveSpan(parentMenuClicked, function(){
childSpanOnParent = Sentry.startInactiveSpan({
name: "gridload",
description: entityPropertyName,
parentSpan: parentMenuClicked,
parentSpanId: parentMenuClicked.spanId,
op: "gridload"
});
});
}
Reference link: #12222
Expected Result
In my Transaction - it should able to track all the HTTP request , reasoucrs, script, etc
Actual Result
In my Transaction - it should able to track all the HTTP request , reasoucrs, script, etc
Metadata
Metadata
Assignees
Type
Projects
Status