* fix: delete outdated metrics port assertions * chore: remove outdated port attribute in metricsType
This commit is contained in:
parent
77101ebeff
commit
05cecc55bc
|
|
@ -21,7 +21,6 @@ import org.apache.dubbo.common.Version;
|
|||
import org.apache.dubbo.common.config.ConfigurationUtils;
|
||||
import org.apache.dubbo.common.config.Environment;
|
||||
import org.apache.dubbo.common.config.InmemoryConfiguration;
|
||||
import org.apache.dubbo.common.utils.Assert;
|
||||
import org.apache.dubbo.common.utils.ClassUtils;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.common.utils.ConfigUtils;
|
||||
|
|
@ -54,7 +53,6 @@ import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY;
|
|||
import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY;
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_NO_METHOD_FOUND;
|
||||
import static org.apache.dubbo.common.constants.MetricsConstants.PROTOCOL_PROMETHEUS;
|
||||
|
||||
/**
|
||||
* AbstractDefaultConfig
|
||||
|
|
@ -267,23 +265,6 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated After metrics config is refactored.
|
||||
* This method should no longer use and will be deleted in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
protected void appendMetricsCompatible(Map<String, String> map) {
|
||||
MetricsConfig metricsConfig = getConfigManager().getMetrics().orElse(null);
|
||||
if (metricsConfig != null) {
|
||||
String protocol = Optional.ofNullable(metricsConfig.getProtocol()).orElse(PROTOCOL_PROMETHEUS);
|
||||
if (!StringUtils.isEquals(protocol, PROTOCOL_PROMETHEUS)) {
|
||||
Assert.notEmptyString(metricsConfig.getPort(), "Metrics port cannot be null");
|
||||
map.put("metrics.protocol", protocol);
|
||||
map.put("metrics.port", metricsConfig.getPort());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To obtain the method list in the port, use reflection when in native mode and javassist otherwise.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -76,13 +76,6 @@ public class MetricsConfig extends AbstractConfig {
|
|||
*/
|
||||
private Integer collectorSyncPeriod;
|
||||
|
||||
/**
|
||||
* @deprecated After metrics config is refactored.
|
||||
* This parameter should no longer use and will be deleted in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* The prometheus metrics config
|
||||
*/
|
||||
|
|
@ -166,14 +159,6 @@ public class MetricsConfig extends AbstractConfig {
|
|||
this.enableRegistry = enableRegistry;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public PrometheusConfig getPrometheus() {
|
||||
return prometheus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -442,7 +442,6 @@ public class ReferenceConfig<T> extends ReferenceConfigBase<T> {
|
|||
AbstractConfig.appendParameters(map, getModule());
|
||||
AbstractConfig.appendParameters(map, consumer);
|
||||
AbstractConfig.appendParameters(map, this);
|
||||
appendMetricsCompatible(map);
|
||||
|
||||
String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
|
||||
if (StringUtils.isEmpty(hostToRegistry)) {
|
||||
|
|
|
|||
|
|
@ -663,7 +663,6 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
|
|||
AbstractConfig.appendParameters(map, provider);
|
||||
AbstractConfig.appendParameters(map, protocolConfig);
|
||||
AbstractConfig.appendParameters(map, this);
|
||||
appendMetricsCompatible(map);
|
||||
|
||||
// append params with method configs,
|
||||
if (CollectionUtils.isNotEmpty(getMethods())) {
|
||||
|
|
|
|||
|
|
@ -1103,12 +1103,6 @@
|
|||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
<xsd:attribute name="port" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[ Deprecated. No longer use. ]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
|
||||
<xsd:attribute name="enable-rpc" type="xsd:boolean" default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[ Enable record rpc metrics. ]]></xsd:documentation>
|
||||
|
|
|
|||
Loading…
Reference in New Issue