Commit 9b003042 by 姜海波

prometheus 监控增加

parent c6f43e35
...@@ -146,7 +146,12 @@ ...@@ -146,7 +146,12 @@
<artifactId>apollo-client</artifactId> <artifactId>apollo-client</artifactId>
<version>1.4.0</version> <version>1.4.0</version>
</dependency> </dependency>
<!-- promtheus -->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>0.6.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -14,6 +14,8 @@ package cn.freemud; ...@@ -14,6 +14,8 @@ package cn.freemud;
import cn.freemud.utils.LogTreadLocal; import cn.freemud.utils.LogTreadLocal;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import io.prometheus.client.spring.boot.EnablePrometheusEndpoint;
import io.prometheus.client.spring.boot.EnableSpringBootMetricsCollector;
import org.jasypt.encryption.StringEncryptor; import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor; import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
...@@ -43,6 +45,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy; ...@@ -43,6 +45,8 @@ import org.springframework.context.annotation.EnableAspectJAutoProxy;
@EnableAspectJAutoProxy @EnableAspectJAutoProxy
@ComponentScan({"cn.freemud","com.freemud"}) @ComponentScan({"cn.freemud","com.freemud"})
@EnableFeignClients @EnableFeignClients
@EnablePrometheusEndpoint
@EnableSpringBootMetricsCollector
@EnableAutoConfiguration @EnableAutoConfiguration
public class ApiApplication { public class ApiApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -9,3 +9,14 @@ apollo.meta=http://212.129.229.203 ...@@ -9,3 +9,14 @@ apollo.meta=http://212.129.229.203
env=dev env=dev
apollo.bootstrap.enabled=true apollo.bootstrap.enabled=true
apollo.bootstrap.namespaces=micro_progeram_commons,i_callback_service apollo.bootstrap.namespaces=micro_progeram_commons,i_callback_service
endpoints.metrics.enabled=true
endpoints.health.sensitive=false
endpoints.health.enabled=true
management.endpoint.health.show-details=always
management.endpoints.web.base-path=/
management.endpoints.web.exposure.include=prometheus,info,health,shutdown
management.metrics.tags.application=${spring.application.name}
management.endpoint.shutdown.enabled=true
management.security.enabled=false
management.health.rabbit.enabled=false
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment