赞
踩
参考:官网集成说明
-javaagent:D:/codesoft/elastic-apm-agent-1.18.0.jar -Delastic.apm.service_name=maniy-application -Delastic.apm.server_urls=http://localhost:8200 -Delastic.apm.application_packages=com.maniy -Delastic.apm.secret_token=
<!-- APM 应用监控 -->
<dependency>
<groupId>co.elastic.apm</groupId>
<artifactId>apm-agent-attach</artifactId>
<version>1.33.0</version>
</dependency>
import co.elastic.apm.attach.ElasticApmAttacher;
import org.springframework.boot.SpringApplication;
@SpringBootApplication
public class MyApplication {
public static void main(String[] args) {
ElasticApmAttacher.attach();
SpringApplication.run(MyApplication.class, args);
}
}
#在配置文件elasticapm.properties中添加如下配置
service_name=maniy-service
application_packages=com.maniy
server_urls=http://127.0.0.1:8200
或者在application.yml中
#elastic APM 应用监控
elastic:
apm:
server_name: ${spring.application.name}
application_packages: com.maniy
# 支持使用路径
use_path_as_transaction_name: true
server_urls: http://127.0.0.1:8200
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。