Skip to content

feat: add path & method labels to prometheus metrics for current requests #17362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 16, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed a bug with path matching
  • Loading branch information
ibetitsmike committed Apr 16, 2025
commit b68853a453441996bda692e5167342ba823501a2
2 changes: 1 addition & 1 deletion coderd/httpmw/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func getRoutePattern(r *http.Request) string {

tctx := chi.NewRouteContext()
routes := rctx.Routes
if routes != nil && routes.Match(tctx, r.Method, routePath) {
if routes != nil && !routes.Match(tctx, r.Method, routePath) {
// No matching pattern. /api/* requests will be matched as "UNKNOWN"
// All other ones will be matched as "STATIC".
if strings.HasPrefix(routePath, "/api/") {
Expand Down
Loading