Skip to content

Commit

Permalink
Revert "added middleware name metric"
Browse files Browse the repository at this point in the history
This reverts commit 33d311f.
  • Loading branch information
bishnuag committed Nov 15, 2022
1 parent fb9f3eb commit d837a1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion runtime/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ const (
scopeTagEndpoint = "endpointid"
scopeTagHandler = "handlerid"
scopeTagError = "error"
scopeTagMiddleWare = "middlewarename"
scopeTagStatus = "status"
scopeTagProtocol = "protocol"
scopeTagHTTP = "HTTP"
Expand Down
5 changes: 2 additions & 3 deletions runtime/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (m *MiddlewareStack) Handle(
//for error metrics only emit when there is gateway error and not request error
// the percentage can be calculated via error_count/total_request
if res.pendingStatusCode >= 500 {
m.emitAvailabilityError(middlewareRequestStatusTag, m.middlewares[i].Name(), req.scope)
m.emitAvailabilityError(middlewareRequestStatusTag, req.scope)
}
return ctx
}
Expand All @@ -137,10 +137,9 @@ func (m *MiddlewareStack) Handle(
}

// emitAvailability is used to increment the error counter for a particular tagName.
func (m *MiddlewareStack) emitAvailabilityError(tagName string, middlewareName string, scope tally.Scope) {
func (m *MiddlewareStack) emitAvailabilityError(tagName string, scope tally.Scope) {
tagged := scope.Tagged(map[string]string{
scopeTagStatus: "error",
scopeTagMiddleWare: middlewareName,
})
tagged.Counter(tagName).Inc(1)
}

0 comments on commit d837a1d

Please sign in to comment.