Newrelic rum.js script strip for specific routes in rails

I use newrelic ruby ​​agent and paste some js code into each hmtl response from my application, for example, into head: var NREUMQ = []; NREUMQ.push (["mark", "firstbyte", new Date (). GetTime ()]);

The problem is that we allow users to post content, and sometimes to host html files. Then newrelic inserts these lines into its html when they click on download ...

An html example downloaded through the site using new links. Any tips on how to share newrelic stuff only for specific routes or any other methods that we can use only for specific code codes?

HTTP/1.1 200 OK
Server: nginx/1.1.8
Date: Thu, 26 Apr 2012 19:25:54 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 1176
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.11
X-UA-Compatible: IE=Edge,chrome=1
Content-Transfer-Encoding: binary
X-Runtime: 0.340155
Progma: cache
Content-Disposition: attachment; filename="404.html"
Expires: 0
Cache-Control: private
Set-Cookie: ;)
Status: 200

<!DOCTYPE html>
<html>
<head><script>var NREUMQ=[];NREUMQ.push(["mark","firstbyte",new Date().getTime()]);</script>
  <title>The page you were looking for doesn't exist (404)</title>
  <style type="text/css">
    body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
    div.dialog {
      width: 25em;
      padding: 0 4em;
      margin: 4em auto 0 auto;
      border: 1px solid #ccc;
      border-right-color: #999;
      border-bottom-color: #999;
    }
    h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
  </style>
</head>

<body>
  <!-- This file lives in public/404.html -->
  <div class="dialog">
    <h1>The page you were looking for doesn't exist.</h1>
    <p>You may have mistyped the address or the page may have moved.</p>
  </div>
<script>(function(){var d=document;var e=d.createElement("script");e.async=true;e.src="https://d1ros97qkrwjf5.cloudfront.net/30/eum/rum.js";var s=d.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s);})();NREUMQ.push(["nrf2","beacon-1.newrelic.com","9dfe439095",309309,"blablabla==",0,336,new Date().getTime()])</script></body>
</html>

:    NewRelic:: Agent:: Instrumentation:: ControllerInstrumentation   newrelic_ignore: only = > "" , , , .

, - , , , newrelic_ignore

+3
1

New Relic RUM - , JS . newrelic.yml, -RUM. . RUM Ruby.

, , , . , - API Ruby .

+5

All Articles