弹性APM代理配置选项不起作用



Elasticsearch、kibana和apm服务器安装在ec2服务器中我已经安装了自动java代理附加到另一个服务器来跟踪詹金斯应用

代理正在连接到进程,但动态配置选项不起作用

镜像目录:(命令ls(

apm-ant-attach-standalone.jar弹性apm.properties

elasticapm.properties文件

service_name="jenkins-dev"
server_url="http://x.x.x.x:8200"
recording=true
enabled=true
log_level="DEBUG"
log_file=_AGENT_HOME_/logs/elastic-apm.log

附加命令:

sudo java-jar apm-attach-standalone.jar--include'<詹金斯>'

->这没有选择配置文件,但附加了代理

所以我用下面的命令来更新

sudo java -jar apm-agent-attach-standalone.jar --include '.*jenkins.*' --config recording=false,enabled=false
sudo java -jar apm-agent-attach-standalone.jar --include '.*jenkins.*' --config 
config_file=elasticapm.properties log_file=/etc/apmagents/apm.log

日志:

2021-04-12 10:47:20,338 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error trying to connect to APM Server. Some details about SSL configurations corresponding the current connection are logged at INFO level.
2021-04-12 10:47:20,339 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused)
2021-04-12 10:47:20,339 [elastic-apm-server-reporter] INFO  co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)
2021-04-12 10:47:24,345 [elastic-apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Connection refused (Connection refused)

查询:

1.在命令行中使用配置选项的正确方法是什么?

2.我们需要创建一个日志文件吗?或者如果使用log_file,它会创建。。现在它污染了应用程序日志

尝试使用以下符号指定config_file

-Delastic.apm.config_file=elasticapm.properties

附件可以根据启动期间配置的设置创建日志文件。请参阅[1]当前代码以获得更好的理解。

[1]https://github.com/elastic/apm-agent-java/blob/0465d479430172c3e745afd2ef5b62a3da6b60aa/apm-agent-attach-cli/src/main/java/co/elastic/apm/attach/AgentAttacher.java#L79

最新更新