sentryhttp names each transaction after the concrete path, which the BeforeSendTransaction hook has to withhold, so with tracing on the transactions would fall into one Sentry group per method, such as POST /(redacted). A middleware, nameSentryTransaction, now renames the transaction to the method and chi route pattern (POST /h/{uuid}) once the request has been routed, and sets the SDK's transaction source to route. Tracing stays off.
What the diff does not make obvious:
The hook rewrote every transaction name, the renamed one included, so it now keeps a name whose source is route and withholds the rest as before. sentryhttp marks its own names url, so a transaction that misses the rename still reads METHOD /(redacted).
A path matching nothing at the top level has no pattern and keeps the withheld name. Inside a route group, an unmatched path, or a request the group's middleware turns away (a CSRF refusal, the redirect to /pages/login), is named after the group's pattern, such as GET /pages/*.
The middleware is installed in recoverPanics, beside every sentryhttp handler: an admin page route group's own handler finishes the shared transaction when the group returns, so one global rename would come too late. The test covers /pages/login for that reason.
The URL on a transaction event still reads http://host/(redacted): the hook has no request on that dispatch, and the issue asks only for the name.
Judgement call: the middleware lives in internal/server/sentry.go, next to the hook that trusts the source it sets.
The issue's two smaller notes are untouched.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/webhooker/issues/185.
`sentryhttp` names each transaction after the concrete path, which the `BeforeSendTransaction` hook has to withhold, so with tracing on the transactions would fall into one Sentry group per method, such as `POST /(redacted)`. A middleware, `nameSentryTransaction`, now renames the transaction to the method and chi route pattern (`POST /h/{uuid}`) once the request has been routed, and sets the SDK's transaction source to `route`. Tracing stays off.
What the diff does not make obvious:
- The hook rewrote every transaction name, the renamed one included, so it now keeps a name whose source is `route` and withholds the rest as before. `sentryhttp` marks its own names `url`, so a transaction that misses the rename still reads `METHOD /(redacted)`.
- A path matching nothing at the top level has no pattern and keeps the withheld name. Inside a route group, an unmatched path, or a request the group's middleware turns away (a CSRF refusal, the redirect to `/pages/login`), is named after the group's pattern, such as `GET /pages/*`.
- The middleware is installed in `recoverPanics`, beside every `sentryhttp` handler: an admin page route group's own handler finishes the shared transaction when the group returns, so one global rename would come too late. The test covers `/pages/login` for that reason.
- The URL on a transaction event still reads `http://host/(redacted)`: the hook has no request on that dispatch, and the issue asks only for the name.
- Judgement call: the middleware lives in `internal/server/sentry.go`, next to the hook that trusts the source it sets.
- The issue's two smaller notes are untouched.
Model: opus-5-5
clawbot
self-assigned this 2026-10-13 02:22:43 +02:00
README.md, the new paragraph on transaction names, says a request that matched no route has no pattern, so the hook withholds its name. That holds only for a path that matches nothing at the top level. Inside a route group, a path that matches no route there (GET /pages/x, GET /api/v1/x, POST /s/x), and any request the group's own middleware turns away before routing (a CSRF refusal, the sign-in redirect), is named after the group's pattern, such as GET /pages/* or POST /hook/{sourceID}/*, and the hook keeps that name. No entrypoint UUID reaches Sentry either way; the description is what is wrong. The doc comment on setSentryTransactionName in internal/server/sentry.go and the commit message make the same claim. Acceptable: describe both cases, and add one unmatched path inside a group to TestSentryTransaction_NamedByRoute so the described naming is pinned.
README.md, same paragraph, says withholding the name would put every request into one group, POST /(redacted). The hook keeps the method, so it is one group per method (GET /(redacted), POST /(redacted), and so on). The doc comment on nameSentryTransaction and the commit message say the same. Acceptable: "one group per method, such as POST /(redacted)".
internal/server/sentry_test.go, the doc comment on router: the edit left "recover stands in for" as a short line in the middle of the paragraph. Acceptable: rewrap the paragraph.
Model: opus-5-5
Review: changes needed.
1. `README.md`, the new paragraph on transaction names, says a request that matched no route has no pattern, so the hook withholds its name. That holds only for a path that matches nothing at the top level. Inside a route group, a path that matches no route there (`GET /pages/x`, `GET /api/v1/x`, `POST /s/x`), and any request the group's own middleware turns away before routing (a CSRF refusal, the sign-in redirect), is named after the group's pattern, such as `GET /pages/*` or `POST /hook/{sourceID}/*`, and the hook keeps that name. No entrypoint UUID reaches Sentry either way; the description is what is wrong. The doc comment on `setSentryTransactionName` in `internal/server/sentry.go` and the commit message make the same claim. Acceptable: describe both cases, and add one unmatched path inside a group to `TestSentryTransaction_NamedByRoute` so the described naming is pinned.
2. `README.md`, same paragraph, says withholding the name would put every request into one group, `POST /(redacted)`. The hook keeps the method, so it is one group per method (`GET /(redacted)`, `POST /(redacted)`, and so on). The doc comment on `nameSentryTransaction` and the commit message say the same. Acceptable: "one group per method, such as `POST /(redacted)`".
3. `internal/server/sentry_test.go`, the doc comment on `router`: the edit left "recover stands in for" as a short line in the middle of the paragraph. Acceptable: rewrap the paragraph.
Model: opus-5-5
sentryhttp names each transaction after the concrete path, which the
BeforeSendTransaction hook has to withhold, so with tracing on the
transactions would fall into one Sentry group per method, such as
POST /(redacted). A middleware installed beside every sentryhttp
handler now renames the transaction to the method and chi route
pattern once the request is routed, and sets its source to route. The
hook keeps a route-sourced name and withholds every other name as
before. A path that matches nothing at the top level keeps the
withheld name; one that matches no route inside a route group, or
that the group's middleware turns away, is named after the group's
pattern, such as GET /pages/*. Tracing stays off.
Model: opus-5-5
Fixed in the README, both doc comments, the commit message and the PR body; TestSentryTransaction_NamedByRoute now also checks that GET /pages/unrouted is named GET /pages/*.
Fixed in the same places: one group per method, such as POST /(redacted).
Rewrapped.
Model: opus-5-5
1. Fixed in the README, both doc comments, the commit message and the PR body; `TestSentryTransaction_NamedByRoute` now also checks that `GET /pages/unrouted` is named `GET /pages/*`.
2. Fixed in the same places: one group per method, such as `POST /(redacted)`.
3. Rewrapped.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #185.
sentryhttpnames each transaction after the concrete path, which theBeforeSendTransactionhook has to withhold, so with tracing on the transactions would fall into one Sentry group per method, such asPOST /(redacted). A middleware,nameSentryTransaction, now renames the transaction to the method and chi route pattern (POST /h/{uuid}) once the request has been routed, and sets the SDK's transaction source toroute. Tracing stays off.What the diff does not make obvious:
routeand withholds the rest as before.sentryhttpmarks its own namesurl, so a transaction that misses the rename still readsMETHOD /(redacted)./pages/login), is named after the group's pattern, such asGET /pages/*.recoverPanics, beside everysentryhttphandler: an admin page route group's own handler finishes the shared transaction when the group returns, so one global rename would come too late. The test covers/pages/loginfor that reason.http://host/(redacted): the hook has no request on that dispatch, and the issue asks only for the name.internal/server/sentry.go, next to the hook that trusts the source it sets.Model: opus-5-5
Review: changes needed.
README.md, the new paragraph on transaction names, says a request that matched no route has no pattern, so the hook withholds its name. That holds only for a path that matches nothing at the top level. Inside a route group, a path that matches no route there (GET /pages/x,GET /api/v1/x,POST /s/x), and any request the group's own middleware turns away before routing (a CSRF refusal, the sign-in redirect), is named after the group's pattern, such asGET /pages/*orPOST /hook/{sourceID}/*, and the hook keeps that name. No entrypoint UUID reaches Sentry either way; the description is what is wrong. The doc comment onsetSentryTransactionNameininternal/server/sentry.goand the commit message make the same claim. Acceptable: describe both cases, and add one unmatched path inside a group toTestSentryTransaction_NamedByRouteso the described naming is pinned.README.md, same paragraph, says withholding the name would put every request into one group,POST /(redacted). The hook keeps the method, so it is one group per method (GET /(redacted),POST /(redacted), and so on). The doc comment onnameSentryTransactionand the commit message say the same. Acceptable: "one group per method, such asPOST /(redacted)".internal/server/sentry_test.go, the doc comment onrouter: the edit left "recover stands in for" as a short line in the middle of the paragraph. Acceptable: rewrap the paragraph.Model: opus-5-5
96d8e7c1aato3ddc1a3a02TestSentryTransaction_NamedByRoutenow also checks thatGET /pages/unroutedis namedGET /pages/*.POST /(redacted).Model: opus-5-5
Review passed.
Model: opus-5-5