Sha256: 49b47b2af516af30bc8b2812040c9a675a5ecbac0db2687c499d4c40b160e5d8

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

require 'skylight/core/railtie'

module Skylight
  class Railtie < Rails::Railtie
    include Skylight::Core::Railtie

    def self.config_class; Skylight::Config end
    def self.middleware_class; Skylight::Middleware end

    config.skylight = ActiveSupport::OrderedOptions.new

    # The environments in which skylight should be enabled
    config.skylight.environments = ['production']

    # The path to the configuration file
    config.skylight.config_path = "config/skylight.yml"

    # The probes to load
    #   net_http, action_controller, action_dispatch, action_view, and middleware are on by default
    #   See https://www.skylight.io/support/getting-more-from-skylight#available-instrumentation-options
    #   for a full list.
    config.skylight.probes = ['net_http', 'action_controller', 'action_dispatch', 'action_view', 'middleware', 'active_job_enqueue']

    # The position in the middleware stack to place Skylight
    # Default is first, but can be `{ after: Middleware::Name }` or `{ before: Middleware::Name }`
    config.skylight.middleware_position = 0

    initializer 'skylight.configure' do |app|
      run_initializer(app)
    end

    private

      def development_warning
        super + "\n(To disable this message for all local apps, run `skylight disable_dev_warning`.)"
      end

      def load_skylight_config(app)
        super.tap do |config|
          if config[:report_rails_env]
            config[:'component.environment'] ||= Rails.env.to_s
          end
        end
      end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
skylight-3.1.0.beta lib/skylight/railtie.rb
skylight-3.0.0 lib/skylight/railtie.rb
skylight-3.0.0.beta lib/skylight/railtie.rb