The metrics middleware labelled each request with its method as sent. Go's HTTP server accepts any method name that is a valid token, and the middleware measures every request before routing, so each made-up method a client sent added series to the registry that were never removed. The method label is now the request's method only for GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, CONNECT and TRACE, and other for any other method. README.md says so where it describes the metrics, next to unmatched for the handler label from #260.
go-http-metrics has no setting for the method label: it reads the method from the request it is handed. So the middleware hands the library a shallow copy of the request whose method is the label, and serves the next handler the original request, through the response writer the library wraps to see the status and size. Handlers and the other middleware still see the method the client sent; the new test checks that too.
The in-flight gauge carries no method label, so only the duration and size histograms change.
The failing test is its own commit ahead of the fix, as the repo's CLAUDE.md asks. No existing test changed.
Judgement call: the shared value is other, lowercase like unmatched.
Model: opus-5-5
The metrics middleware labelled each request with its method as sent. Go's HTTP server accepts any method name that is a valid token, and the middleware measures every request before routing, so each made-up method a client sent added series to the registry that were never removed. The `method` label is now the request's method only for `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `CONNECT` and `TRACE`, and `other` for any other method. `README.md` says so where it describes the metrics, next to `unmatched` for the `handler` label from https://git.eeqj.de/sneak/pixa/pulls/260.
go-http-metrics has no setting for the method label: it reads the method from the request it is handed. So the middleware hands the library a shallow copy of the request whose method is the label, and serves the next handler the original request, through the response writer the library wraps to see the status and size. Handlers and the other middleware still see the method the client sent; the new test checks that too.
The in-flight gauge carries no method label, so only the duration and size histograms change.
The failing test is its own commit ahead of the fix, as the repo's `CLAUDE.md` asks. No existing test changed.
- Judgement call: the shared value is `other`, lowercase like `unmatched`.
Model: opus-5-5
The test sends two requests with made-up methods through the metrics
middleware and expects /metrics to count both under the method label
"other", and the handler to see each method as sent. It fails until the
middleware stops using every method name as its own label value.
Model: opus-5-5
The method label was each request's method as sent, and Go's HTTP
server accepts any method name, so made-up methods added series to the
registry that were never removed. It is now the method only for GET,
HEAD, POST, PUT, PATCH, DELETE, OPTIONS, CONNECT and TRACE, and "other"
for any other. go-http-metrics reads the method from the request it is
handed, so the middleware hands it a copy carrying the label and serves
the next handler the original request.
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.
The metrics middleware labelled each request with its method as sent. Go's HTTP server accepts any method name that is a valid token, and the middleware measures every request before routing, so each made-up method a client sent added series to the registry that were never removed. The
methodlabel is now the request's method only forGET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS,CONNECTandTRACE, andotherfor any other method.README.mdsays so where it describes the metrics, next tounmatchedfor thehandlerlabel from #260.go-http-metrics has no setting for the method label: it reads the method from the request it is handed. So the middleware hands the library a shallow copy of the request whose method is the label, and serves the next handler the original request, through the response writer the library wraps to see the status and size. Handlers and the other middleware still see the method the client sent; the new test checks that too.
The in-flight gauge carries no method label, so only the duration and size histograms change.
The failing test is its own commit ahead of the fix, as the repo's
CLAUDE.mdasks. No existing test changed.other, lowercase likeunmatched.Model: opus-5-5
Review passed.
Model: opus-5-5