lib/skylight/instrumenter.rb in skylight-1.0.0.beta4 vs lib/skylight/instrumenter.rb in skylight-1.0.0.beta5

- old
+ new

@@ -105,30 +105,29 @@ Skylight.warn_skylight_native_missing(config) return end t { "starting instrumenter" } - @config.validate! - unless validate_authentication - warn "invalid authentication token" + unless config.validate_with_server + log_error "invalid config" return end t { "starting native instrumenter" } unless native_start warn "failed to start instrumenter" return end - @config.gc.enable + config.gc.enable @subscriber.register! self rescue Exception => e - log_error "failed to start instrumenter; msg=%s; config=%s", e.message, @config.inspect + log_error "failed to start instrumenter; msg=%s; config=%s", e.message, config.inspect t { e.backtrace.join("\n") } nil end def shutdown @@ -250,36 +249,10 @@ false end end def ignore?(trace) - @config.ignored_endpoints.include?(trace.endpoint) - end - - # Validates that the provided authentication token is valid. This is done - # by issuing a request for a session token and checking the response - def validate_authentication - # If a session token is specified, don't bother attempting to validate - if config[:session_token] - debug "using pre-generated session token" - true - else - api = Api.new(config) - api.authentication = config[:authentication] - - case res = api.validate_authentication - when :ok - true - when :invalid - false - when :unknown - warn "unable to validate authentication token" - true - else - error "[BUG] unexpected validate_token result; res=%s", res - true - end - end + config.ignored_endpoints.include?(trace.endpoint) end end end