cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autoinjection script with custom context path

viveksingh87
Visitor

Hi,

By default dynatrace scripts are injected into head section with root context path like 

<script type="text/javascript" src="/ruxitagentjs_ICANVfqru_1029924090310435ssd4.js".....>

I was looking in Dynatrace settings where I can define context path so that scripts injected will be with custom context path (/webapp/bio/).

<script type="text/javascript" src="/webapp/bio/ruxitagentjs_ICANVfqru_10299240903104354.js"...>

8 REPLIES 8

Hi @viveksingh87 ,

You can change it  going to Settings of your application,  Capturing > Advanced setup, RUM monitoring code section and specify path for RUM monitoring code:

erh_inetum_0-1726721233014.png

Hope it helps.

Regards,

Elena.

Thank you Elena,

 

I have also tried configuring "/webapp/bio/" under Capturing > Advanced setup and checked application head tag in browser still script does not have context path. Does one agent look for context path from any tag on index.html

 

<script type="text/javascript" src="/ruxitagentjs_ICANVfqru_1029924090310435ssd4.js".....>

Hi @viveksingh87 ,

When you say "Does one agent look for context path from any tag on index.html", do you mean to place ruxit on index.html? If you mean this, you can define a custom injection rule to inject ruxitagent on index.html:

erh_inetum_0-1726806550402.png

Regards,

Elena.

I have setup that as below

viveksingh87_0-1727214869103.png

but even after that script does not prefix context path "/webapp/biometric/"

viveksingh87_1-1727214928356.png

 

As a result script failed to download

viveksingh87_2-1727214977787.png

 

Hi @viveksingh87 ,

That you're trying to get is inject ruxit on page "/webapp/bio/" and change the ruxitagent path from "/ruxitagentjs_.....js" to "/webapp/bio/ruxitagentjs_.....js", right?

Have you tried to specify the path from RUM monitoring code in Advance Settings and also defining the custom injection rule?

Regards,

Elena.

Yes I have tried that. I have updated the path from RUM monitoring code in Advance Settings and also defined the custom injection rule. 

Hi @viveksingh87 ,

If you go to Application > your_app > Settings > Injection, Manual insertion, do you see the desired path?

Something like 

<script type="text/javascript" src="/webapp/bio/ruxitagentjs_ICANVfghqru_10299240903104354.js" data-dtconfig="app=---...............</script>

Maybe you have to copy the snippet in your page. As far as I know it shouldn´t required but you can test it.

Or someone can provide a better answer than mine.

Regards,

Elena.

PacoPorro
Dynatrace Leader
Dynatrace Leader

Be aware that the path Elena mention does not need to exist, the oneagent will take care of the new path.

Featured Posts