If tracing is ever enabled, every Sentry transaction will collapse into one bucket named POST /(redacted) #185
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by the independent review of #181. Deliberately NOT milestoned 1.0.0 — tracing is off in this service, so nothing is broken today.
#179 stopped the receiver's capability UUID reaching Sentry by substituting the chi route pattern. The pattern is reachable on the error dispatch, via the request the SDK carries on
hint.Context. It is not reachable on the transaction dispatch:Span.doFinishcallshub.CaptureEvent(event)with a nil hint, whichclient.go:620-622replaces with an empty&EventHint{}— non-nil,Contextnil, no request. SoBeforeSendTransactioncorrectly falls back.The consequence, which is correct behaviour and still a problem: the moment someone enables tracing, every transaction gets the name
POST /(redacted)and the URLscheme://host/(redacted). Sentry groups transactions by name, so the entire service becomes one bucket and the performance data is worthless.That is not a defect in #181 — the fallback has to be safe, and safe means withholding. It is a trap laid for whoever turns tracing on, who will see one meaningless bucket and may well "fix" it by reverting the redaction and putting the capability back.
The fix, for whoever enables tracing
A middleware registered after routing that sets the transaction name from
chi.RouteContext(r.Context()).RoutePattern()— at which point the name is correct at source and the hook's fallback never fires for it.sentry.TransactionFromContext(r.Context())gives the span to rename.Definition of done
Only actionable once tracing is wanted; until then this is a documented trap.
(redacted)and not the concrete path.BeforeSendTransactionfallback stays as the floor — the new middleware must be an improvement on it, not a replacement for it, so a dispatch that somehow misses the middleware still withholds.Two smaller notes from the same review, recorded here rather than lost
sentryTransactionNamecuts on the first space, so a name that is notMETHOD /pathand contains a space becomesfirstWord /(redacted). Safe, and unreachable while the SDK is the only thing setting the name — but a hand-set name would meet it.Implementation requirements
next, PR based onnext, single commit, title ending(closes #N).TODO.md(see #112).make bootstrapin a fresh clone before gating — browser assets are fetched at build time, andmake lintneeds Docker.make checkplus the Docker lint path with the cache defeated. All linting runs in Docker, never on the host.