moooofly / hunter-agent

This is an agent for hunter system as a proxy.
MIT License
2 stars 0 forks source link

[BUG] Can not specify same config in both /etc/hunter/agent.json and CLI flag #5

Open moooofly opened 6 years ago

moooofly commented 6 years ago

phenomenon

[#1073#root@ubuntu-1604 /go/src/github.com/moooofly/hunter-agent]$cat /etc/hunter/agent.json
{
    "debug": true,
    "pidfile": "/var/run/hunter-agent.pid",
    "data-root": "/var/lib/hunter",
    "shutdown-timeout": 15,
    "log-level": "",
    "raw-logs": false,
    "metrics-addr": "0.0.0.0:12346" . -- here
}
[#1074#root@ubuntu-1604 /go/src/github.com/moooofly/hunter-agent]$

and

[#1074#root@ubuntu-1604 /go/src/github.com/moooofly/hunter-agent]$./agent -H tcp://0.0.0.0:12345 -H unix:///var/run/hunter-agent.sock --metrics-addr 0.0.0.0:12346 --broker xx.xx.xx.xx:9092 --topic jaeger-spans-test-001
unable to configure the hunter-agent with file /etc/hunter/agent.json: the following directives are specified both as a flag and in the configuration file: metrics-addr: (from flag: 0.0.0.0:12346, from file: 0.0.0.0:12346)
[#1075#root@ubuntu-1604 /go/src/github.com/moooofly/hunter-agent]$

solution

Should remove one of them.