Elastic APM 代理配置选项不起作用

Elastic APM Agent Configuration Options are not working

Elasticsearch、kibana 和 apm-server 安装在 ec2 服务器上 我已经安装了自动 java 代理附加到另一台服务器以跟踪 jenkins 应用程序

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

Apmagent 目录:(命令 ls)

apm-agent-attach-standalone.jar elasticapm.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-agent-attach-standalone.jar --include '.jenkins.'

->这不是选择配置文件而是附加代理

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

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.Which 是在命令行中使用配置选项的正确方法吗?

2.Do 我们需要创建一个日志文件,否则它会在使用 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