2012-04-26 4 views
3

私はnewrelic ruby​​エージェントを使用しています。私のアプリからの各hmtlレスポンスにいくつかのjsコードを挿入しています。例:var NREUMQ = []; NREUMQ.push ["mark"、 "firstbyte"、新しいDate()。getTime()]);レール内のあるルートのnewrelic rum.jsスクリプトを削除

問題は、ユーザーがコンテンツをホストすることができ、時にはhtmlファイルをホストできることです。次に、newrelicはこれらの行をHTMLをクリックしてダウンロードします。

例htmlは、サイトからnewrelic追加でダウンロードしました。特定のルートのみ、または特定のコードパスにのみ使用できるその他の方法でnewrelicのものを取り除く方法についてアドバイスしますか?

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 ::エージェント::計装:: ControllerInstrumentationが含ま newrelic_ignore:のみ=>私のコントローラで を "ダウンロード"、どんな効果を持っていないようです。

私は私の乗客を再起動すると、コードは、しばらくの間の任意のページに追加されていないことの後に、それは、すべてのページになっても持っているものnewrelic_ignore

あなたは新しいの自動計測器をオフにすることができ

答えて

5

Relic RUM - あなたのページに自動的にJSが挿入されますnewrelic.ymlに自動RUMのオンとオフを切り替える設定があります。詳細については、documentation for RUM in Rubyを参照してください。

これを実行したら、エンドユーザーページの読み込み時間を測定するアクションの計測器を手動で追加できます。これを行う方法は、ドキュメントにも記述されています。ページにヘッダーとフッターを挿入するRubyエージェントAPIメソッドを呼び出します。

+4

New Relicカスタマーサポートに相談した後、これはグローバルにしか達成できず、個別に追加されます。 – Michael

+0

[newrelic_ignore_enduser](https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ignoring-specific-transactions#page-load-timing-rum)を使用してコントローラのブラックリストを作成することができます。 ) – Arth

関連する問題