0

当我的网站仅受登录密码门保护时,Mixpanel 没有在实时视图上显示 New relic ping,但我知道它正在 ping,因为它在我的网站关闭时显示。现在由于某种原因,由于我们删除了意味着网站是公开的“门”,因此每 20 秒新的文物 ping 就会显示在 Mixpanel 实时视图上。这很糟糕。new relic 和 mixpanel 都已与 Ruby 集成。

知道是什么原因造成的吗?

谢谢

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
4

2 回答 2

0

由于 New Relic pinger 发送标准 GET 或 HEAD 请求,并且仅在响应 URL 返回 200 时才报告,因此如果您在其他外部 GET 或 HEAD 请求中看到相同的行为,将会很有趣。Mixplanel 是否在监控到达密码网关的外部 GET 或 HEAD 请求?如果不是,那可以解释为什么您现在看到 ping。您可能需要检查 Mixpanel 以调查为什么在删除密码门后开始出现 pinger 通知。

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

于 2014-04-10T16:59:50.327 回答
0

我找到了一个解决方案,基本上在 Mixpanel 跟踪器中,我添加了一个小代码,说忽略登录页面上的新遗迹 ping

于 2014-04-22T05:21:15.350 回答