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

RUM injection failure when Azure Front Door caching enabled

GregOReilly
Advisor

We have found an issue when using kuberneres+OneAgent+RUM injection with some applications. Support helped us to eliminate possible causes and to narrow in on caching at the AFD level.

When caching is enabled, RUM injection does not work. If we disable caching on AFD, RUM Injection works every time.

To circumvent this issue, we've resorted to manual JavaScript injection.

Has anyone come across an alternative solution for this challenge?

4 REPLIES 4

Ana_Kuzmenchuk
Community Team
Community Team

Hi @GregOReilly, were you able to find an alternative solution for this issue? Thank you!

The only constant is change. Finding ways for great things to happen!

Hello Anna, manual injection was the only method that worked. Using Oneagent and automated injection of Javascript did not work with Cache enabled on Azure Front Door(s). 

tom_desair
Visitor

Hi,

We had this same issue and we seem to have solved it by:

  1. In the Application settings in Dynatrace under "Injection" -> "Automatic injection", specify "/dynatrace/" as the location for JavaScript library file.
  2. In Azure Front Door, create a rule to disable caching for any request path that starts with "/dynatrace/".

MargitM
Dynatrace Contributor
Dynatrace Contributor

Thanks for raising this, Greg.

When you say "RUM injection does not work", I interpret that to mean the RUM JavaScript snippet is not injected into the page at all. Based on the setup, I suspect this is due to an unfavorable caching policy: the page is likely being served from the edge cache for an extended period, so the request never reaches the origin — and the OneAgent never gets a chance to inject the snippet.

The fact that manual insertion worked could be due to a few reasons:

  • A cache purge during deployment of the new version (which included the manually inserted snippet), or
  • A cache-busting mechanism like asset versioning.

Tom mentioned they had a similar issue, but the solution he described only works if the RUM JavaScript snippet was already injected, and only the request for the RUM monitoring code itself did not reach the origin. So his case shows that RUM injection can work with Azure Front Door, and the issue here is likely more about caching behavior than a fundamental incompatibility.

To me, this sounds like a classic CDN-related scenario we've seen before: The OneAgent can't inject as long as the page is served from the edge. Except for waiting for the cache to expire, the only solutions are:

  • Purging the cache manually, and
  • Reducing cache durations going forward to avoid long-lived stale content.

👉 Greg, please correct me if I misunderstood what you meant by "RUM injection does not work."

Featured Posts