Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7869515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:20:56+00:00 2026-06-03T01:20:56+00:00

I am using newrelic ruby agent and it is inserting some js code to

  • 0

I am using newrelic ruby agent and it is inserting some js code to each hmtl response from my app, for example in head: var NREUMQ=[];NREUMQ.push([“mark”,”firstbyte”,new Date().getTime()]);

Problem is, that we allow users to host content, and sometimes they host html files. Then newrelic is inserting these lines to their html when they click on download…

Example html downloaded through site with newrelic additions. Any advice how to strip the newrelic stuff only for certain routes or any other methods that we can use for specific code paths only?

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>

I have tried using:
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
newrelic_ignore :only => “download”
In my controller, but it does not seem to have any effect.

When I restart my passenger, the code is not appended to any page for a short while, after that, it is to all pages, even those that have newrelic_ignore

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:20:57+00:00Added an answer on June 3, 2026 at 1:20 am

    You can turn off auto-instrumentation for New Relic RUM–that’s what’s inserting the JS automatically in your pages. There’s a setting in newrelic.yml that turns auto-RUM on and off. See the documentation for RUM in Ruby for details.

    After you’ve done that, you can manually add back instrumentation for the actions you want to measure end user page load time for. How to do so is also described in the docs–you call Ruby agent API methods to insert a header and footer in your pages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
We're using NewRelic to monitor a Sinatra app. We don't want the probe URL
Using LINQ on collections, what is the difference between the following lines of code?
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
I'm using NewRelic for monitoring. I want Maven to package both newrelic.jar and newrelic.yaml
Using mercurial, I've run into an odd problem where a line from one committer
Using this code, the following execution yields strange results: C 100 R W The
Using Visual Studio / C#, I've been debugging some nunit tests recently, and am
I'm having a problem with memcached. I'm using the example by Gregg Pollack here
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.