docs: private void getMetrics(
        MBeanServerConnection con,
        MetricFilter filter,
        List<Metric> metrics,
        ObjectName name)
        throws JMException, IOException {
      // Create tags from the object name
      TagList tags = createTagList(name);
      MBeanInfo info = con.getMBeanInfo(name);
      MBeanAttributeInfo[] attrInfos = info.getAttributes();
  
      // Restrict to attributes that match the filter
      List<String> matchingNames = new ArrayList<>();
      for (MBeanAttributeInfo attrInfo : attrInfos) {
        String attrName = attrInfo.getName();
        if (filter.matches(new MonitorConfig.Builder(attrName).withTags(tags).build())) {
          matchingNames.add(attrName);
        }
      }
      List<Attribute> attributeList = safelyLoadAttributes(con, name, matchingNames);
  
      for (Attribute attr : attributeList) {
        String attrName = attr.getName();
        Object obj = attr.getValue();
        if (obj instanceof TabularData) {
          ((TabularData) obj).values().stream()
              .filter(key -> key instanceof CompositeData)
              .forEach(key -> addTabularMetrics(filter, metrics, tags, attrName,
                  (CompositeData) key));
        } else if (obj instanceof CompositeData) {
          addCompositeMetrics(filter, metrics, tags, attrName, (CompositeData) obj);
        } else {
          addMetric(metrics, attrName, tags, obj);
        }
      }
    }