|
@@ -1,11 +1,15 @@
|
|
|
package com.sqx;
|
|
package com.sqx;
|
|
|
|
|
|
|
|
import com.sqx.common.utils.MyGlobalThreadPool;
|
|
import com.sqx.common.utils.MyGlobalThreadPool;
|
|
|
|
|
+import io.micrometer.core.instrument.MeterRegistry;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
+import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.context.ApplicationEvent;
|
|
import org.springframework.context.ApplicationEvent;
|
|
|
import org.springframework.context.ApplicationListener;
|
|
import org.springframework.context.ApplicationListener;
|
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.event.ContextClosedEvent;
|
|
import org.springframework.context.event.ContextClosedEvent;
|
|
|
|
|
|
|
|
@SpringBootApplication
|
|
@SpringBootApplication
|
|
@@ -36,4 +40,9 @@ public class SqxApplication implements CommandLineRunner, ApplicationListener<Ap
|
|
|
MyGlobalThreadPool.shutdown(false);
|
|
MyGlobalThreadPool.shutdown(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Bean
|
|
|
|
|
+ MeterRegistryCustomizer<MeterRegistry> configurer(@Value("${spring.application.name}") String applicationName, @Value("${spring.profiles.active}") String active) {
|
|
|
|
|
+ return (registry) -> registry.config().commonTags("application", applicationName + "-" + active);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|