Sha256: 695394174fefa69edd569f35b610228144071f28e51acb3306ae7161f76a5582

Contents?: true

Size: 1004 Bytes

Versions: 8

Compression:

Stored size: 1004 Bytes

Contents

module Skylight
  class Instrumenter < Core::Instrumenter
    def self.trace_class
      Trace
    end

    def check_install!
      # Warn if there was an error installing Skylight.

      if defined?(Skylight.check_install_errors)
        Skylight.check_install_errors(config)
      end

      if !Skylight.native? && defined?(Skylight.warn_skylight_native_missing)
        Skylight.warn_skylight_native_missing(config)
        return
      end
    end

    def process_sql(sql)
      Skylight.lex_sql(sql)
    rescue SqlLexError => e
      if config[:log_sql_parse_errors]
        config.logger.error "[#{e.formatted_code}] Failed to extract binds from SQL query. " \
                            "It's likely that this query uses more advanced syntax than we currently support. " \
                            "sql=#{sql.inspect}"
      end
      nil
    end

    def handle_instrumenter_error(trace, e)
      poison! if e.is_a?(Skylight::InstrumenterUnrecoverableError)
      super
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
skylight-4.3.2 lib/skylight/instrumenter.rb
skylight-4.3.1 lib/skylight/instrumenter.rb
skylight-4.3.0 lib/skylight/instrumenter.rb
skylight-4.2.3 lib/skylight/instrumenter.rb
skylight-4.2.2 lib/skylight/instrumenter.rb
skylight-4.2.1 lib/skylight/instrumenter.rb
skylight-4.2.0 lib/skylight/instrumenter.rb
skylight-4.2.0.beta3 lib/skylight/instrumenter.rb