Github user NicoK commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4110#discussion_r126443494
  
    --- Diff: 
flink-metrics/flink-metrics-statsd/src/main/java/org/apache/flink/metrics/statsd/StatsDReporter.java
 ---
    @@ -193,7 +198,10 @@ private void send(final String name, final String 
value) {
        @Override
        public String filterCharacters(String input) {
                char[] chars = null;
    -           final int strLen = input.length();
    +           if (input.length() > maxComponentLength) {
    +                   log.warn("The metric name component {} exceeded the {} 
characters length limit and was truncated.", input, maxComponentLength);
    +           }
    +           final int strLen = Math.min(input.length(), maxComponentLength);
    --- End diff --
    
    same here about the `Math.min`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to