Sha256: f6bef4d8cbd65660d8e8a8427c7eb30cb89e98c8f7763d8f8ac05a7ec5052e93

Contents?: true

Size: 872 Bytes

Versions: 6

Compression:

Stored size: 872 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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
skylight-4.2.0.beta2 lib/skylight/instrumenter.rb
skylight-4.2.0.beta lib/skylight/instrumenter.rb
skylight-4.1.2 lib/skylight/instrumenter.rb
skylight-4.1.1 lib/skylight/instrumenter.rb
skylight-4.1.1.beta lib/skylight/instrumenter.rb
skylight-4.1.0 lib/skylight/instrumenter.rb