I am using a fleet-managed agent with the ActiveMQ integration to attempt to monitor ActiveMQ metrics. When I deploy, I get this error from the agent:
[elastic_agent.metricbeat][error] Error fetching data for metricset activemq.queue: failed to unmarshal jolokia JSON response '{"error_type":"java.lang.Exception","error":"java.lang.Exception : Origin null is not allowed to call this agent","status":403}': json: cannot unmarshal object into Go value of type []jmx.Entry
In doing some research, it appears that the only thing required to resolve this error is to add an Origin: ...
header to the HTTP request, e.g.:
Origin: http://localhost
And, in fact, when I execute that from the command line as follows, I am able to retrieve the data I'm looking for:
curl -ks -u ${USERNAME}:${PASSWORD} 'http://localhost:8161/api/jolokia/?ignoreErrors=true&canonicalNaming=false' -H 'Origin: http://localhost'
However, I don't appear to be able to add any custom headers to a Fleet-managed ActiveMQ integration. Is this possible, and how do I do it?