app/vmauth: fix metric name prefixes: vmagent -> vmauth

This commit is contained in:
Aliaksandr Valialkin 2021-10-19 15:29:07 +03:00
parent 5df7ef323f
commit 0a1982b294
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -23,7 +23,7 @@ var (
maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host") maxIdleConnsPerBackend = flag.Int("maxIdleConnsPerBackend", 100, "The maximum number of idle connections vmauth can open per each backend host")
reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...") reloadAuthKey = flag.String("reloadAuthKey", "", "Auth key for /-/reload http endpoint. It must be passed as authKey=...")
logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+ logInvalidAuthTokens = flag.Bool("logInvalidAuthTokens", false, "Whether to log requests with invalid auth tokens. "+
`Such requests are always counted at vmagent_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`) `Such requests are always counted at vmauth_http_request_errors_total{reason="invalid_auth_token"} metric, which is exposed at /metrics page`)
) )
func main() { func main() {
@ -109,9 +109,9 @@ func proxyRequest(w http.ResponseWriter, r *http.Request) {
} }
var ( var (
configReloadRequests = metrics.NewCounter(`vmagent_http_requests_total{path="/-/reload"}`) configReloadRequests = metrics.NewCounter(`vmauth_http_requests_total{path="/-/reload"}`)
invalidAuthTokenRequests = metrics.NewCounter(`vmagent_http_request_errors_total{reason="invalid_auth_token"}`) invalidAuthTokenRequests = metrics.NewCounter(`vmauth_http_request_errors_total{reason="invalid_auth_token"}`)
missingRouteRequests = metrics.NewCounter(`vmagent_http_request_errors_total{reason="missing_route"}`) missingRouteRequests = metrics.NewCounter(`vmauth_http_request_errors_total{reason="missing_route"}`)
) )
var reverseProxy = &httputil.ReverseProxy{ var reverseProxy = &httputil.ReverseProxy{