code: public boolean matches(MonitorConfig config) {
      String name = config.getName();
      TagList tags = config.getTags();
      String value;
      if (tagKey == null) {
        value = name;
      } else {
        Tag t = tags.getTag(tagKey);
        value = (t == null) ? null : t.getValue();
      }
  
      boolean match = matchIfMissingTag;
      if (value != null) {
        match = pattern.matcher(value).matches();
      }
      return match ^ invert;
    }
docs: {@inheritDoc}