willholley commented on code in PR #4474:
URL: https://github.com/apache/couchdb/pull/4474#discussion_r1135212339


##########
src/couch_prometheus/src/couch_prometheus_util.erl:
##########
@@ -146,9 +146,9 @@ path_to_name(Path) ->
 
 counter_metric(Path) ->
     Name = path_to_name(Path),
-    case string:find(Name, <<"_total">>, trailing) == <<"_total">> of
-        true -> Name;
-        false -> to_bin(io_lib:format("~s_total", [Name]))
+    case string:find(Name, <<"_total">>, trailing) of
+        nomatch -> to_bin(io_lib:format("~s_total", [Name]));
+        _ -> Name

Review Comment:
   thanks - the solution with `lists:suffix` looks correct as we only want to 
match a strict suffix. I've pushed an update which uses that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to