# How to inject JS agent from application useing owin to self-host webapi

**URL:** <https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216>\
**Category:** Open Q&A\
**Tags:** javascript\
**Created:** [April 1, 2019, 9:05pm UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216 "2019-04-01T21:05:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 1, 2019, 9:05pm UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/1 "2019-04-01T21:05:38Z")

</div>

Hi guys,

Prospect are running their application with owin self-host web api ([https://docs.microsoft.com/en-us/aspnet/web-api/ov…](https://docs.microsoft.com/en-us/aspnet/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api%29)

Agent work OK and we can see server side information but no JS agent is being inject into the html pages that are coming from this PG.

When checking the PG setting the JS injection is set on

Any suggestions why there is no injection here?

Thanks in advance

Yos

---

<div class="post-metadata">

**Author:** ![rohithsamudrala](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rohithsamudrala/32/9652_2.png) [@rohithsamudrala](https://community.dynatrace.com/u/rohithsamudrala)\
**Post date:** [April 1, 2019, 10:00pm UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/2 "2019-04-01T22:00:17Z")

</div>

Hey Yos,

Can you confirm that you have turned on monitoring for all the processes from the Deployment status page?

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [April 2, 2019, 6:34am UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/3 "2019-04-02T06:34:53Z")

</div>

In general you have Web Api as I understand. So you don’t have monitoring on processes that are serving frontend or on mobile devices. Am I correct? If yes you should install OneAgent (or inject it manually) on WebServer where front is serving. If this API is for mobile app you should check documentation about how to instrument them.

Sebastian

---

<div class="post-metadata">

**Author:** ![AlexanderSommer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alexandersommer/32/2501_2.png) [@AlexanderSommer](https://community.dynatrace.com/u/AlexanderSommer)\
**Post date:** [April 2, 2019, 6:50am UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/4 "2019-04-02T06:50:47Z")

</div>

Hi Yos,

I guess you don’t have a web server like IIS in front of your application. Even if the OneAgent is installed and monitoring this process it is not capable of doing the real user monitoring injection on the .NET or in your case OWIN process.  
You can put an IIS (or Apache, Nginx) in front of OWIN and then the RUM injection is done at this tier.  
Please take a look at the Real user monitoring auto injection section here: [Technology support — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/supported-technologies#real-user-monitoring)

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 2, 2019, 7:23am UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/5 "2019-04-02T07:23:20Z")

</div>

Hi [@Alexander S.](https://answers.dynatrace.com/users/12024/view.html)

Yes you are right there is no WebServer in front of the OWIN and since .net is not list as auto-injection technology there will be no auto-injection 😞

 ![20188-real-user-monitoring-auto-injection.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/888bfa955273bfddd50140aae4f6109d97afef01.png)

Thanks

Yos

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 2, 2019, 7:25am UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/6 "2019-04-02T07:25:02Z")

</div>

Hi [@Sebastian K.](https://answers.dynatrace.com/users/3343/view.html)

Thanks for your input - thats not the issue here , please see down [@Alexander S.](https://answers.dynatrace.com/users/12024/view.html) answer

Yos

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [April 2, 2019, 7:44am UTC](https://community.dynatrace.com/t/how-to-inject-js-agent-from-application-useing-owin-to-self-host-webapi/20216/7 "2019-04-02T07:44:16Z")

</div>

Hן [@Rohith S.](https://answers.dynatrace.com/users/15272/view.html) process is monitor the issue as [@Alexander S.](https://answers.dynatrace.com/users/12024/view.html) point is that .net is not auto injection technology

Thanks for your answer

Yos
