<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: xxx
* Operating System version: xxx
* Java version: xxx

### Steps to reproduce this issue

```xml
    <bean id="sayHi" class="org.apache.dubbo.samples.provider.GreetingsServiceImpl"/>

    <dubbo:service id="GreetingsServiceRef1" interface="org.apache.dubbo.samples.api.GreetingsService" ref="sayHi">
        <dubbo:method name="sayHi" timeout="1000" retries="3"/>
    </dubbo:service>
```

Pls. provide [GitHub address] to reproduce this issue.

### Expected Behavior

<!-- What do you expect from the above steps？-->

### Actual Behavior

<!-- What actually happens? -->

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```

} else if (ConsumerConfig.class.equals(beanClass)) {
            parseNested(element, parserContext, ReferenceBean.class, true, "reference", "consumer", beanName, beanDefinition);
        } else if (ReferenceBean.class.equals(beanClass)) {
            configReferenceBean(element, parserContext, beanDefinition, null);
        } else if (MetricsConfig.class.equals(beanClass)) {
            parseMetrics(element, parserContext, beanDefinition);
        }
        
        if (parserContext.getRegistry().containsBeanDefinition(beanName)) {
            throw new IllegalStateException("Duplicate spring bean name: " + beanName);
        }
        if (registered) {
            parserContext.getRegistry().registerBeanDefinition(beanName, beanDefinition);
        }
        return beanDefinition;
    }
    private static void parseMetrics(Element element, ParserContext parserContext, RootBeanDefinition beanDefinition) {
        NodeList childNodes = element.getChildNodes();
        PrometheusConfig prometheus = null;
        for (int i = 0; i < childNodes.getLength(); i++) {
            if (!(childNodes.item(i) instanceof Element)) {
                continue;
            }
            Element child = (Element) childNodes.item(i);
            if ("aggregation".equals(child.getNodeName()) || "aggregation".equals(child.getLocalName())) {
                AggregationConfig aggregation = new AggregationConfig();
                assignProperties(aggregation, child, parserContext);
                beanDefinition.getPropertyValues().addPropertyValue("aggregation", aggregation);
            }else if("histogram".equals(child.getNodeName()) || "histogram".equals(child.getLocalName())){
                HistogramConfig histogram = new HistogramConfig();