# Add custom headers to fleet-managed ActiveMQ integration

**URL:** <https://discuss.elastic.co/t/add-custom-headers-to-fleet-managed-activemq-integration/317925>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [November 1, 2022, 8:02pm UTC](https://discuss.elastic.co/t/add-custom-headers-to-fleet-managed-activemq-integration/317925 "2022-11-01T20:02:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [November 1, 2022, 8:02pm UTC](https://discuss.elastic.co/t/add-custom-headers-to-fleet-managed-activemq-integration/317925/1 "2022-11-01T20:02:01Z")

</div>

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:

```auto
[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.:

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![DougR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dougr/32/48095_2.png) [@DougR](https://discuss.elastic.co/u/DougR)\
**Post date:** [November 2, 2022, 1:36pm UTC](https://discuss.elastic.co/t/add-custom-headers-to-fleet-managed-activemq-integration/317925/2 "2022-11-02T13:36:03Z")

</div>

When I dug into how the policy is built/deployed, there is an "SSL Configuration" field under the metrics advanced configuration (see below).

![Screen Shot 2022-11-02 at 8.31.11 AM](https://us1.discourse-cdn.com/elastic/original/3X/5/4/54bbcb0f1f45922e502b3f88313952d6ca31a2b2.png)

However, based on the sample shown in the field, it appears to be more of a generic "additional configuration" field, so I added the following:

```yaml
headers:
  Origin: 'http://localhost'

```

and redeployed, which resolved the issue. I was also able to successfully add event processors to the integration using this.

I don't know whether this will change in the future, but it works for now. I would strongly suggest that this field be changed from "SSL Configuration" to "Additional Configuration."

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 30, 2022, 1:36pm UTC](https://discuss.elastic.co/t/add-custom-headers-to-fleet-managed-activemq-integration/317925/3 "2022-11-30T13:36:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
