# How to instrument a different XmlHttpRequest Object

**URL:** <https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662>\
**Category:** APM\
**Tags:** rum\
**Created:** [November 13, 2019, 9:11am UTC](https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662 "2019-11-13T09:11:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_fernandez/32/51925_2.png) [@Carlos\_Fernandez](https://discuss.elastic.co/u/Carlos_Fernandez)\
**Post date:** [November 13, 2019, 9:11am UTC](https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662/1 "2019-11-13T09:11:46Z")

</div>

Hello,

I have been started using APM-RUM agent and I found the need of patch and instrument a different XmlHttpRequest object. Is there any way to do that? I think this can be a really interesting feature.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [November 15, 2019, 10:14am UTC](https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662/2 "2019-11-15T10:14:32Z")

</div>

Hi Carlos,

Thanks for posting the question. Could you help me understand the feature request in detail?

When you say `different XmlHttpRequest` does it mean the one that is being instrumented via the RUM agent or some other API that the agent does not instrument at the moment?

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![Carlos\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_fernandez/32/51925_2.png) [@Carlos\_Fernandez](https://discuss.elastic.co/u/Carlos_Fernandez)\
**Post date:** [November 15, 2019, 11:04am UTC](https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662/3 "2019-11-15T11:04:03Z")

</div>

Hi Vignesh,

Thanks for your quick response. Nowadays is common the use of an Iframe for cross domain ajax request without CORS. In this case, the RUM agent is not able to instrument the XmlHttpRequest object of the Iframe. Having a look to the RUM agent code I was able to see how RUM was doing the instrumentation and I did a small test trying to instrument the Iframe object. But this is not a proper solution. It would be interesting if the RUM agent could provide this on the API somehow.

Thanks!

---

<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:** [December 6, 2019, 7:04am UTC](https://discuss.elastic.co/t/how-to-instrument-a-different-xmlhttprequest-object/207662/4 "2019-12-06T07:04:03Z")

</div>

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