Question

When my website was only protected by a login pwd gate, Mixpanel was not showing New relic pings on the Live View but I know it was pinging as it was showing when my website was down. Now for some reason, since we remove the “gate” meaning the website is public, new relic every 20 seconds pings are showing on the Mixpanel Live View. This is terrible. Both new relic and mixpanel have been integrated with Ruby.

Any idea what could cause this?

Thanks

class ApplicationController < ActionController::Base

http_basic_authenticate_with name: "xxxx", password: "xxx", if: Proc.new{ Rails.env.staging? }

# before_filter :check_beta_user
  before_filter :get_tracker

  before_filter :verify_account_existance, :except => [:destroy]
   include SimpleCaptcha::ControllerHelpers

  def check_beta_user
#    return if Rails.env == "development"
    return true unless Rails.env.production?
    session[:beta] = true if request.referrer && request.referrer == "http://signup.mawwell.com/"
    return redirect_to "http://xxxxxx.com/" unless session[:beta]
  end

  def get_tracker
    @tracker =  Mixpanel::Tracker.new(MIXPANEL_CONFIG[:key])

    if current_user
      @user_tracker_id = current_user.email
    else
      if !session[:anonymous_uid]
        session[:anonymous_uid] = SecureRandom.uuid
      end
      @user_tracker_id = session[:anonymous_uid]
    end

  end

  def verify_account_existance
    if I18n.locale == :ar
        I18n.locale = :ar
        cookies['googtrans'] =""
        cookies['googtrans']="/ar"
      elsif I18n.locale == :en
        I18n.locale = :en
        cookies['googtrans'] = ""
        cookies['googtrans']="/en"
      end
    if params.present? and params['action'] == "change_language" and params['controller'] == "users"
      if I18n.locale == :ar
        I18n.locale = :en
        cookies['googtrans'] =""
        cookies['googtrans']="/en"
      elsif I18n.locale == :en
        I18n.locale = :ar
        cookies['googtrans'] = ""
        cookies['googtrans']="/ar"
      end
    end
      if user_signed_in? && !current_user.is_active?
        sign_out(current_user)
        return redirect_to new_user_session_path, :alert => "Your account has been deactivated"
      end
  end

  rescue_from CanCan::AccessDenied do |exception|
    redirect_to root_url, :alert => exception.message
  end

end
Was it helpful?

Solution 2

I found a solution and basically in the Mixpanel tracker, I added a small code saying to ignore new relic pings on the landing page

OTHER TIPS

Since the New Relic pinger sends a standard GET or HEAD request and is only reporting if the responding URL returns a 200, it would be interesting to find out if you are seeing the same behavior with other external GET or HEAD requests. Was Mixplanel monitoring external GET or HEAD requests that hit the password gateway? If not, that could explain why you are seeing the pings now. You may want to check with Mixpanel to investigate why the pinger notifications started appearing after removing the password gate.

https://discuss.newrelic.com/t/issue-new-relic-pings-showing-mixpanel/1089/2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top