Comments (6)
@AbhiPrasad the absence of the sampling flag delegates the sampling decision to the receiving SDK. There is a defined order of what takes precedence, defined in https://develop.sentry.dev/sdk/performance/#sampling and implemented here https://github.com/getsentry/sentry-go/blob/master/tracing.go#L427-L511.
from sentry-javascript.
hey @DarkByteZero - attaching the headers is by intention given distributed tracing does not depend on performance monitoring (generating spans) in Sentry.
When there is no active pageload though the sentry trace should be not attaching a sampled flag. This is indicated by no -1
being attached to d1f4373147294b14ab220450dc8ca2c6-9f0c782faa520627
, like we see in the earlier header acc3a2d245d4404789d4cabe533996d7-bbd6bd5567ae8a87-1
.
The Go SDK should be parsing a sample rate of 0 if this is dropped, @cleptric could you help sanity check this?
from sentry-javascript.
I appreciate the intention behind attaching headers for distributed tracing, but what is the reason for sending these trace headers, if there isn't even a parent transaction in the sentry system collected. Another Problem is the frequency at with these traces are changed, like in my image you can see that multiple API requests are aggregated into one trace, but there is a big gap between them, this makes it difficult to debug.
from sentry-javascript.
@AbhiPrasad @DarkByteZero We need to change how we do trace propagation without active spans in the frontend. The current implementation has issues and leads to traces like @DarkByteZero outlined. These traces have absolutely no value.
Concretely, we have to do one of two things:
- Stop having an always-ambient trace propagation context.
- Stop picking up the context when performance is enabled.
from sentry-javascript.
hey @DarkByteZero - attaching the headers is by intention given distributed tracing does not depend on performance monitoring (generating spans) in Sentry.
When there is no active pageload though the sentry trace should be not attaching a sampled flag. This is indicated by no
-1
being attached tod1f4373147294b14ab220450dc8ca2c6-9f0c782faa520627
, like we see in the earlier headeracc3a2d245d4404789d4cabe533996d7-bbd6bd5567ae8a87-1
.The Go SDK should be parsing a sample rate of 0 if this is dropped, @cleptric could you help sanity check this?
The GO SDK does not interpret the absence of the sampled flag as a sampled false. Actually, if it would do, all api transactions would not be sampled, which would be bad.
// updateFromSentryTrace parses a sentry-trace HTTP header (as returned by
// ToSentryTrace) and updates fields of the span. If the header cannot be
// recognized as valid, the span is left unchanged. The returned value indicates
// whether the span was updated.
func (s *Span) updateFromSentryTrace(header []byte) (updated bool) {
m := sentryTracePattern.FindSubmatch(header)
if m == nil {
// no match
return false
}
_, _ = hex.Decode(s.TraceID[:], m[1])
_, _ = hex.Decode(s.ParentSpanID[:], m[2])
if len(m[3]) != 0 {
switch m[3][0] {
case '0':
s.Sampled = SampledFalse
case '1':
s.Sampled = SampledTrue
}
}
return true
}
from sentry-javascript.
I think this issue right here is a symptom of the JS SDK having a buggy/confusing trace propagation when no spans are active. We will fix this in the upcoming major (v8). It will lead to slightly less connected-ness within your data but at least unrelated stuff isn't gonna be connected anymore.
from sentry-javascript.
Related Issues (20)
- Self hosted sentry did not record transaction information HOT 2
- Modifications to `@TraceClassDecorator` and `@TraceMethodDecorator`
- [v8] Port `@sentry/astro` to be powered by OpenTelemetry
- [v8] Port `@sentry/remix` to be powered by OpenTelemetry
- [v8] Port `@sentry/sveltekit` to be powered by OpenTelemetry
- [v8] Port `@sentry/nextjs` to be powered by OpenTelemetry
- Problems with Next.js SDK + OTEL
- [Flaky CI]: replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts
- [Flaky CI]: loader/noOnLoad/captureException/test.ts:6:11 › captureException works
- [v8] Docs Changes
- Make `@sentry/aws-serverless` and `@sentry/google-cloud-serverless` ESM compat
- Make Remix SDK ESM compat
- @sentry/core/types/index"' has no exported member 'getSpanStatusFromHttpCode'. HOT 3
- Error handling within Hapi Sentry integration HOT 3
- OpenTelemetry Instrumentation Issues
- Ensure. `Sentry.captureUserFeedback(feedback)` is exported from node packages HOT 3
- The integration for node profiling (nodeProfilingIntegration) is causing the Next.js build to fail. HOT 3
- Migrate from ts-node to tsx
- Migrate from jest to vitest and stop using jsdom based tests HOT 1
- Colons (`:`) in HTML class names can cause Replay player to not apply the CSS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-javascript.