feature:support pushGateway push metrics

pull/504/head
wulingxiao 3 years ago
parent 4f33405061
commit 2c61fafcd6

@ -19,6 +19,7 @@
package com.tencent.cloud.plugin.pushgateway; package com.tencent.cloud.plugin.pushgateway;
import com.tencent.cloud.polaris.context.ConditionalOnPolarisEnabled; import com.tencent.cloud.polaris.context.ConditionalOnPolarisEnabled;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -36,7 +37,7 @@ public class PolarisStatPushGatewayAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public PolarisStatPushGatewayModifier polarisStatPushGatewayModifier(PolarisStatPushGatewayProperties polarisStatPushGatewayProperties, public PolarisStatPushGatewayModifier polarisStatPushGatewayModifier(PolarisStatPushGatewayProperties polarisStatPushGatewayProperties,
Environment environment) { Environment environment) {
return new PolarisStatPushGatewayModifier(polarisStatPushGatewayProperties, environment); return new PolarisStatPushGatewayModifier(polarisStatPushGatewayProperties, environment);
} }
} }

@ -21,8 +21,8 @@ package com.tencent.cloud.plugin.pushgateway;
import com.tencent.cloud.common.constant.ContextConstant; import com.tencent.cloud.common.constant.ContextConstant;
import com.tencent.cloud.polaris.context.PolarisConfigModifier; import com.tencent.cloud.polaris.context.PolarisConfigModifier;
import com.tencent.polaris.factory.config.ConfigurationImpl; import com.tencent.polaris.factory.config.ConfigurationImpl;
import com.tencent.polaris.plugins.stat.pushgateway.handler.PrometheusPushHandlerConfig; import com.tencent.polaris.plugins.stat.pushgateway.handler.PrometheusPushHandlerConfig;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
/** /**
@ -39,7 +39,7 @@ public class PolarisStatPushGatewayModifier implements PolarisConfigModifier {
private final Environment environment; private final Environment environment;
public PolarisStatPushGatewayModifier(PolarisStatPushGatewayProperties polarisStatPushGatewayProperties, public PolarisStatPushGatewayModifier(PolarisStatPushGatewayProperties polarisStatPushGatewayProperties,
Environment environment) { Environment environment) {
this.polarisStatPushGatewayProperties = polarisStatPushGatewayProperties; this.polarisStatPushGatewayProperties = polarisStatPushGatewayProperties;
this.environment = environment; this.environment = environment;
} }

@ -19,6 +19,7 @@
package com.tencent.cloud.plugin.pushgateway; package com.tencent.cloud.plugin.pushgateway;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;

@ -19,6 +19,7 @@
package com.tencent.cloud.plugin.pushgateway; package com.tencent.cloud.plugin.pushgateway;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;

@ -20,6 +20,7 @@ package com.tencent.cloud.plugin.pushgateway;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;

Loading…
Cancel
Save