bc-prometheus-ruby 0.3.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +12 -10
- data/bc-prometheus-ruby.gemspec +5 -6
- data/lib/bigcommerce/prometheus/client.rb +8 -0
- data/lib/bigcommerce/prometheus/collectors/base.rb +5 -2
- data/lib/bigcommerce/prometheus/configuration.rb +8 -3
- data/lib/bigcommerce/prometheus/instrumentors/resque.rb +2 -0
- data/lib/bigcommerce/prometheus/instrumentors/web.rb +3 -1
- data/lib/bigcommerce/prometheus/integrations/railtie.rb +1 -1
- data/lib/bigcommerce/prometheus/server.rb +10 -4
- data/lib/bigcommerce/prometheus/servers/thin/controllers/send_metrics_controller.rb +1 -0
- data/lib/bigcommerce/prometheus/servers/thin/server.rb +2 -1
- data/lib/bigcommerce/prometheus/servers/thin/server_metrics.rb +1 -1
- data/lib/bigcommerce/prometheus/type_collectors/base.rb +1 -0
- data/lib/bigcommerce/prometheus/type_collectors/resque.rb +2 -0
- data/lib/bigcommerce/prometheus/version.rb +1 -1
- data/lib/bigcommerce/prometheus.rb +3 -0
- metadata +25 -39
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f64feca1c573ea1651030c807d187ae729e4fc744c2d6ac5f31813694ae9102c
         | 
| 4 | 
            +
              data.tar.gz: 6bdf42e5208734507d42741df44677d07ded19db3e1a4f55fe204b2b763bbc11
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f3712517b2e2b841b8dbeedabb9f822b7352af1b30f08d1f38fe4d65ad6722df69388222e088b923f6187bc8315896097640cd839a8bf7e4991d29bc11ec6097
         | 
| 7 | 
            +
              data.tar.gz: 5ef32a6ffba766cb9fb3c7bcbc64ec81e0f718030c612430e4ce3ba8e54e8a72f4dfdc8e0f3ce6916c8e697bdb4c7ddb1c5fa0435088b2800c009473c6ebf932
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -2,6 +2,27 @@ Changelog for the bc-prometheus-ruby gem. | |
| 2 2 |  | 
| 3 3 | 
             
            ### Pending Release
         | 
| 4 4 |  | 
| 5 | 
            +
            ## 0.5.2
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            - Better error handling post-fork for web/resque instrumentors
         | 
| 8 | 
            +
            - Fix issue with using `Collectors::Base` and keyword arguments in Ruby 2.7
         | 
| 9 | 
            +
            - Remove null-logger development dependency
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            ### 0.5.1
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            - Fix keywords argument issue with Collectors::Base and Ruby 3.0+
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            ### 0.5.0
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            - Add configuration to disable the Railtie that activates the web instrumentor automatically. This allows applications to choose how and when this is initialized.
         | 
| 18 | 
            +
            - Bump prometheus_exporter gem
         | 
| 19 | 
            +
            - Start testing against Ruby 3.0
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            ### 0.4.0
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            - Add configuration to control Thin web server thread pool size. Note that the default number of threads is changing from 20 to 3. You can configure this using an environment variable or initializer.
         | 
| 24 | 
            +
            - Update rubocop to 1.0
         | 
| 25 | 
            +
             | 
| 5 26 | 
             
            ### 0.3.1
         | 
| 6 27 |  | 
| 7 28 | 
             
            - Update prometheus_exporter dependency to ~> 0.5 to fix memory leaks
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # bc-prometheus-ruby - Drop-in Prometheus metrics
         | 
| 2 2 |  | 
| 3 | 
            -
            [](https://circleci.com/gh/bigcommerce/bc-prometheus-ruby) [](https://badge.fury.io/rb/bc-prometheus-ruby) [](https://circleci.com/gh/bigcommerce/bc-prometheus-ruby) [](https://badge.fury.io/rb/bc-prometheus-ruby) [](https://inch-ci.org/github/bigcommerce/bc-prometheus-ruby?branch=main)
         | 
| 4 4 |  | 
| 5 5 | 
             
            ## Installation
         | 
| 6 6 |  | 
| @@ -39,15 +39,17 @@ Bigcommerce::Prometheus::Instrumentors::Resque.new(app: Rails.application).start | |
| 39 39 |  | 
| 40 40 | 
             
            After requiring the main file, you can further configure with:
         | 
| 41 41 |  | 
| 42 | 
            -
            | Option | Description | Default |
         | 
| 43 | 
            -
            | ------ | ----------- | ------- |
         | 
| 44 | 
            -
            | client_custom_labels | A hash of custom labels to send with each client request | `{}` |
         | 
| 45 | 
            -
            | client_max_queue_size | The max amount of metrics to send before flushing | 10000 |
         | 
| 46 | 
            -
            | client_thread_sleep | How often to sleep the worker thread that manages the client buffer (seconds) | 0.5 |
         | 
| 47 | 
            -
            | puma_collection_frequency | How often to poll puma collection metrics (seconds) | 30 |
         | 
| 48 | 
            -
            | server_host | The host to run the exporter on | 0.0.0.0 |
         | 
| 49 | 
            -
            | server_port | The port to run the exporter on | 9394 |
         | 
| 50 | 
            -
            |  | 
| 42 | 
            +
            | Option | Description | Default | Environment Variable |
         | 
| 43 | 
            +
            | ------ | ----------- | ------- | -------------------- |
         | 
| 44 | 
            +
            | client_custom_labels | A hash of custom labels to send with each client request | `{}` | None |
         | 
| 45 | 
            +
            | client_max_queue_size | The max amount of metrics to send before flushing | `10000` | `ENV['PROMETHEUS_CLIENT_MAX_QUEUE_SIZE']` |
         | 
| 46 | 
            +
            | client_thread_sleep | How often to sleep the worker thread that manages the client buffer (seconds) | `0.5` | `ENV['PROMETHEUS_CLIENT_THREAD_SLEEP']` |
         | 
| 47 | 
            +
            | puma_collection_frequency | How often to poll puma collection metrics (seconds) | `30` | `ENV['PROMETHEUS_PUMA_COLLECTION_FREQUENCY']` |
         | 
| 48 | 
            +
            | server_host | The host to run the exporter on | `"0.0.0.0"` | `ENV['PROMETHEUS_SERVER_HOST']` |
         | 
| 49 | 
            +
            | server_port | The port to run the exporter on | `9394` | `ENV['PROMETHEUS_SERVER_PORT']` |
         | 
| 50 | 
            +
            | server_thread_pool_size | The number of threads used for the exporter server | `3` | `ENV['PROMETHEUS_SERVER_THREAD_POOL_SIZE']` |
         | 
| 51 | 
            +
            | process_name | What the current process name is (used in logging) | `"unknown"` | `ENV['PROCESS']` |
         | 
| 52 | 
            +
            | railtie_disabled | Opt out flag for Railtie; use `Bigcommerce::Prometheus::Instrumentors::Web.new(app: Rails.application).start` in your app's code to start it up yourself  | `0` | `ENV['PROMETHEUS_DISABLE_RAILTIE']` |
         | 
| 51 53 |  | 
| 52 54 | 
             
            ## Custom Collectors
         | 
| 53 55 |  | 
    
        data/bc-prometheus-ruby.gemspec
    CHANGED
    
    | @@ -15,7 +15,7 @@ | |
| 15 15 | 
             
            # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
         | 
| 16 16 | 
             
            # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         | 
| 17 17 | 
             
            #
         | 
| 18 | 
            -
             | 
| 18 | 
            +
            $LOAD_PATH.push File.expand_path('lib', __dir__)
         | 
| 19 19 | 
             
            require 'bigcommerce/prometheus/version'
         | 
| 20 20 |  | 
| 21 21 | 
             
            Gem::Specification.new do |spec|
         | 
| @@ -33,16 +33,15 @@ Gem::Specification.new do |spec| | |
| 33 33 | 
             
              spec.require_paths = ['lib']
         | 
| 34 34 | 
             
              spec.required_ruby_version = '>= 2.6'
         | 
| 35 35 |  | 
| 36 | 
            +
              spec.add_development_dependency 'bundler-audit', '>= 0.6'
         | 
| 37 | 
            +
              spec.add_development_dependency 'pry', '>= 0.12'
         | 
| 36 38 | 
             
              spec.add_development_dependency 'rake', '>= 10.0'
         | 
| 37 39 | 
             
              spec.add_development_dependency 'rspec', '>= 3.8'
         | 
| 38 40 | 
             
              spec.add_development_dependency 'rspec_junit_formatter', '>= 0.4'
         | 
| 39 | 
            -
              spec.add_development_dependency ' | 
| 40 | 
            -
              spec.add_development_dependency 'null-logger', '>= 0.1'
         | 
| 41 | 
            -
              spec.add_development_dependency 'pry', '>= 0.12'
         | 
| 42 | 
            -
              spec.add_development_dependency 'rubocop', '>= 0.74'
         | 
| 41 | 
            +
              spec.add_development_dependency 'rubocop', '>= 1.0'
         | 
| 43 42 | 
             
              spec.add_development_dependency 'simplecov', '>= 0.16'
         | 
| 44 43 |  | 
| 45 44 | 
             
              spec.add_runtime_dependency 'bigcommerce-multitrap', '~> 0.1'
         | 
| 46 | 
            -
              spec.add_runtime_dependency 'prometheus_exporter', '~> 0. | 
| 45 | 
            +
              spec.add_runtime_dependency 'prometheus_exporter', '~> 0.7'
         | 
| 47 46 | 
             
              spec.add_runtime_dependency 'thin', '~> 1.7'
         | 
| 48 47 | 
             
            end
         | 
| @@ -24,6 +24,14 @@ module Bigcommerce | |
| 24 24 | 
             
                  include Singleton
         | 
| 25 25 | 
             
                  include Loggable
         | 
| 26 26 |  | 
| 27 | 
            +
                  ##
         | 
| 28 | 
            +
                  # @param [String] host
         | 
| 29 | 
            +
                  # @param [Integer] port
         | 
| 30 | 
            +
                  # @param [Integer] max_queue_size
         | 
| 31 | 
            +
                  # @param [Integer|Float] thread_sleep
         | 
| 32 | 
            +
                  # @param [Hash] custom_labels
         | 
| 33 | 
            +
                  # @param [String] process_name
         | 
| 34 | 
            +
                  #
         | 
| 27 35 | 
             
                  def initialize(host: nil, port: nil, max_queue_size: nil, thread_sleep: nil, custom_labels: nil, process_name: nil)
         | 
| 28 36 | 
             
                    super(
         | 
| 29 37 | 
             
                      host: host || Bigcommerce::Prometheus.server_host,
         | 
| @@ -25,8 +25,11 @@ module Bigcommerce | |
| 25 25 | 
             
                    ##
         | 
| 26 26 | 
             
                    # Start the collector
         | 
| 27 27 | 
             
                    #
         | 
| 28 | 
            -
                     | 
| 29 | 
            -
             | 
| 28 | 
            +
                    # @param [Hash] args
         | 
| 29 | 
            +
                    #
         | 
| 30 | 
            +
                    def self.start(args = {}, &block)
         | 
| 31 | 
            +
                      args ||= {}
         | 
| 32 | 
            +
                      process_collector = new(**args, &block)
         | 
| 30 33 |  | 
| 31 34 | 
             
                      stop if @thread
         | 
| 32 35 |  | 
| @@ -42,6 +42,7 @@ module Bigcommerce | |
| 42 42 | 
             
                    server_port: ENV.fetch('PROMETHEUS_SERVER_PORT', PrometheusExporter::DEFAULT_PORT).to_i,
         | 
| 43 43 | 
             
                    server_timeout: ENV.fetch('PROMETHEUS_DEFAULT_TIMEOUT', PrometheusExporter::DEFAULT_TIMEOUT).to_i,
         | 
| 44 44 | 
             
                    server_prefix: ENV.fetch('PROMETHEUS_DEFAULT_PREFIX', PrometheusExporter::DEFAULT_PREFIX).to_s,
         | 
| 45 | 
            +
                    server_thread_pool_size: ENV.fetch('PROMETHEUS_SERVER_THREAD_POOL_SIZE', 3).to_i,
         | 
| 45 46 |  | 
| 46 47 | 
             
                    # Custom collector configuration
         | 
| 47 48 | 
             
                    collector_collection_frequency: ENV.fetch('PROMETHEUS_DEFAULT_COLLECTOR_COLLECTION_FREQUENCY_SEC', 15).to_i,
         | 
| @@ -50,7 +51,10 @@ module Bigcommerce | |
| 50 51 | 
             
                    resque_collectors: [],
         | 
| 51 52 | 
             
                    resque_type_collectors: [],
         | 
| 52 53 | 
             
                    web_collectors: [],
         | 
| 53 | 
            -
                    web_type_collectors: []
         | 
| 54 | 
            +
                    web_type_collectors: [],
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                    # Additional configuration
         | 
| 57 | 
            +
                    railtie_disabled: ENV.fetch('PROMETHEUS_DISABLE_RAILTIE', 0).to_i.positive?
         | 
| 54 58 | 
             
                  }.freeze
         | 
| 55 59 |  | 
| 56 60 | 
             
                  attr_accessor *VALID_CONFIG_KEYS.keys
         | 
| @@ -76,6 +80,7 @@ module Bigcommerce | |
| 76 80 | 
             
                    reset unless @configured
         | 
| 77 81 | 
             
                    yield self
         | 
| 78 82 | 
             
                    @configured = true
         | 
| 83 | 
            +
                    self
         | 
| 79 84 | 
             
                  end
         | 
| 80 85 |  | 
| 81 86 | 
             
                  ##
         | 
| @@ -118,8 +123,8 @@ module Bigcommerce | |
| 118 123 | 
             
                      self.logger = Application.logger
         | 
| 119 124 | 
             
                    else
         | 
| 120 125 | 
             
                      require 'logger'
         | 
| 121 | 
            -
                      self.logger = ::Logger.new( | 
| 122 | 
            -
                       | 
| 126 | 
            +
                      self.logger = ::Logger.new($stdout)
         | 
| 127 | 
            +
                      logger.level = ::Logger::Severity::INFO
         | 
| 123 128 | 
             
                    end
         | 
| 124 129 | 
             
                  end
         | 
| 125 130 |  | 
| @@ -70,6 +70,8 @@ module Bigcommerce | |
| 70 70 | 
             
                      ::Resque.before_first_fork do
         | 
| 71 71 | 
             
                        ::Bigcommerce::Prometheus::Integrations::Resque.start(client: Bigcommerce::Prometheus.client)
         | 
| 72 72 | 
             
                        @collectors.each(&:start)
         | 
| 73 | 
            +
                      rescue StandardError => e
         | 
| 74 | 
            +
                        logger.error "[bigcommerce-prometheus][#{@process_name}] Failed to start resque prometheus middleware after fork: #{e.message}"
         | 
| 73 75 | 
             
                      end
         | 
| 74 76 | 
             
                    end
         | 
| 75 77 | 
             
                  end
         | 
| @@ -79,13 +79,15 @@ module Bigcommerce | |
| 79 79 | 
             
                      @app.config.after_fork_callbacks << lambda do
         | 
| 80 80 | 
             
                        ::Bigcommerce::Prometheus::Integrations::Puma.start(client: Bigcommerce::Prometheus.client)
         | 
| 81 81 | 
             
                        @collectors.each(&:start)
         | 
| 82 | 
            +
                      rescue StandardError => e
         | 
| 83 | 
            +
                        logger.error "[bigcommerce-prometheus][#{@process_name}] Failed to start web prometheus middleware after fork: #{e.message}"
         | 
| 82 84 | 
             
                      end
         | 
| 83 85 | 
             
                    end
         | 
| 84 86 |  | 
| 85 87 | 
             
                    def setup_middleware
         | 
| 86 88 | 
             
                      @app.middleware.unshift(PrometheusExporter::Middleware, client: Bigcommerce::Prometheus.client)
         | 
| 87 89 | 
             
                    rescue StandardError => e
         | 
| 88 | 
            -
                      logger.warn "[ | 
| 90 | 
            +
                      logger.warn "[bigcommerce-prometheus] Failed to attach app middleware in web instrumentor: #{e.message}"
         | 
| 89 91 | 
             
                    end
         | 
| 90 92 | 
             
                  end
         | 
| 91 93 | 
             
                end
         | 
| @@ -23,7 +23,7 @@ module Bigcommerce | |
| 23 23 | 
             
                  #
         | 
| 24 24 | 
             
                  class Railtie < ::Rails::Railtie
         | 
| 25 25 | 
             
                    initializer 'zzz.bc_prometheus_ruby.configure_rails_initialization' do |app|
         | 
| 26 | 
            -
                      Bigcommerce::Prometheus::Instrumentors::Web.new(app: app).start
         | 
| 26 | 
            +
                      Bigcommerce::Prometheus::Instrumentors::Web.new(app: app).start unless ::Bigcommerce::Prometheus.railtie_disabled
         | 
| 27 27 | 
             
                    end
         | 
| 28 28 | 
             
                  end
         | 
| 29 29 | 
             
                end
         | 
| @@ -26,15 +26,21 @@ module Bigcommerce | |
| 26 26 | 
             
                  # @param [Integer] port
         | 
| 27 27 | 
             
                  # @param [Integer] timeout
         | 
| 28 28 | 
             
                  # @param [String] prefix
         | 
| 29 | 
            +
                  # @param [Integer] thread_pool_size
         | 
| 29 30 | 
             
                  #
         | 
| 30 | 
            -
                  def initialize(host: nil, port: nil, timeout: nil, prefix: nil, logger: nil)
         | 
| 31 | 
            +
                  def initialize(host: nil, port: nil, timeout: nil, prefix: nil, logger: nil, thread_pool_size: nil)
         | 
| 31 32 | 
             
                    @host = host || ::Bigcommerce::Prometheus.server_host
         | 
| 32 33 | 
             
                    @port = (port || ::Bigcommerce::Prometheus.server_port).to_i
         | 
| 33 34 | 
             
                    @timeout = (timeout || ::Bigcommerce::Prometheus.server_timeout).to_i
         | 
| 34 35 | 
             
                    @prefix = (prefix || ::PrometheusExporter::DEFAULT_PREFIX).to_s
         | 
| 35 36 | 
             
                    @process_name = ::Bigcommerce::Prometheus.process_name
         | 
| 36 37 | 
             
                    @logger = logger || ::Bigcommerce::Prometheus.logger
         | 
| 37 | 
            -
                    @server = ::Bigcommerce::Prometheus::Servers::Thin::Server.new( | 
| 38 | 
            +
                    @server = ::Bigcommerce::Prometheus::Servers::Thin::Server.new(
         | 
| 39 | 
            +
                      port: @port,
         | 
| 40 | 
            +
                      timeout: @timeout,
         | 
| 41 | 
            +
                      logger: @logger,
         | 
| 42 | 
            +
                      thread_pool_size: (thread_pool_size || ::Bigcommerce::Prometheus.server_thread_pool_size).to_i
         | 
| 43 | 
            +
                    )
         | 
| 38 44 | 
             
                    @running = false
         | 
| 39 45 | 
             
                    ::PrometheusExporter::Metric::Base.default_prefix = @prefix
         | 
| 40 46 | 
             
                    setup_signal_handlers
         | 
| @@ -51,7 +57,7 @@ module Bigcommerce | |
| 51 57 | 
             
                    end
         | 
| 52 58 | 
             
                    @running = true
         | 
| 53 59 |  | 
| 54 | 
            -
                    @logger.info "[bigcommerce-prometheus][#{@process_name}] Prometheus exporter started on #{@host}:#{@port}"
         | 
| 60 | 
            +
                    @logger.info "[bigcommerce-prometheus][#{@process_name}] Prometheus exporter started on #{@host}:#{@port} with #{@server.threadpool_size} threads"
         | 
| 55 61 |  | 
| 56 62 | 
             
                    @server
         | 
| 57 63 | 
             
                  rescue ::StandardError => e
         | 
| @@ -78,7 +84,7 @@ module Bigcommerce | |
| 78 84 | 
             
                    @server.stop!
         | 
| 79 85 | 
             
                    @run_thread.kill
         | 
| 80 86 | 
             
                    @running = false
         | 
| 81 | 
            -
                     | 
| 87 | 
            +
                    $stdout.puts "[bigcommerce-prometheus][#{@process_name}] Prometheus exporter cleanly shut down"
         | 
| 82 88 | 
             
                  rescue ::StandardError => e
         | 
| 83 89 | 
             
                    warn "[bigcommerce-prometheus][#{@process_name}] Failed to stop exporter: #{e.message}"
         | 
| 84 90 | 
             
                  end
         | 
| @@ -23,7 +23,7 @@ module Bigcommerce | |
| 23 23 | 
             
                    # Thin adapter for server
         | 
| 24 24 | 
             
                    #
         | 
| 25 25 | 
             
                    class Server < ::Thin::Server
         | 
| 26 | 
            -
                      def initialize(port | 
| 26 | 
            +
                      def initialize(port: nil, host: nil, timeout: nil, logger: nil, thread_pool_size: nil)
         | 
| 27 27 | 
             
                        @port = port || ::Bigcommerce::Prometheus.server_port
         | 
| 28 28 | 
             
                        @host = host || ::Bigcommerce::Prometheus.server_host
         | 
| 29 29 | 
             
                        @timeout = timeout || ::Bigcommerce::Prometheus.server_timeout
         | 
| @@ -31,6 +31,7 @@ module Bigcommerce | |
| 31 31 | 
             
                        @rack_app = ::Bigcommerce::Prometheus::Servers::Thin::RackApp.new(timeout: timeout, logger: logger)
         | 
| 32 32 | 
             
                        super(@host, @port, @rack_app)
         | 
| 33 33 | 
             
                        ::Thin::Logging.logger = @logger
         | 
| 34 | 
            +
                        self.threadpool_size = (thread_pool_size || ::Bigcommerce::Prometheus.server_thread_pool_size).to_i
         | 
| 34 35 | 
             
                      end
         | 
| 35 36 |  | 
| 36 37 | 
             
                      ##
         | 
| @@ -35,7 +35,7 @@ module Bigcommerce | |
| 35 35 | 
             
                        @metrics_total = ::PrometheusExporter::Metric::Counter.new('collector_metrics_total', 'Total metrics processed by exporter.')
         | 
| 36 36 | 
             
                        @sessions_total = ::PrometheusExporter::Metric::Counter.new('collector_sessions_total', 'Total send_metric sessions processed by exporter.')
         | 
| 37 37 | 
             
                        @bad_metrics_total = ::PrometheusExporter::Metric::Counter.new('collector_bad_metrics_total', 'Total mis-handled metrics by collector.')
         | 
| 38 | 
            -
                        @collector_working_gauge = ::PrometheusExporter::Metric::Gauge.new('collector_working', 'Is the  | 
| 38 | 
            +
                        @collector_working_gauge = ::PrometheusExporter::Metric::Gauge.new('collector_working', 'Is the main process collector able to collect metrics')
         | 
| 39 39 | 
             
                        @collector_rss_gauge = ::PrometheusExporter::Metric::Gauge.new('collector_rss', 'total memory used by collector process')
         | 
| 40 40 | 
             
                      end
         | 
| 41 41 |  | 
| @@ -29,6 +29,7 @@ module Bigcommerce | |
| 29 29 | 
             
                    # @param [Hash] default_labels
         | 
| 30 30 | 
             
                    #
         | 
| 31 31 | 
             
                    def initialize(type: nil, default_labels: {})
         | 
| 32 | 
            +
                      super()
         | 
| 32 33 | 
             
                      @type = type || self.class.to_s.downcase.gsub('::', '_').gsub('typecollector', '')
         | 
| 33 34 | 
             
                      @default_labels = default_labels || {}
         | 
| 34 35 | 
             
                      @metrics = build_metrics
         | 
    
        metadata
    CHANGED
    
    | @@ -1,113 +1,99 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: bc-prometheus-ruby
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.5.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Shaun McCormick
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-12-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            -
              name:  | 
| 15 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            -
                requirements:
         | 
| 17 | 
            -
                - - ">="
         | 
| 18 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '10.0'
         | 
| 20 | 
            -
              type: :development
         | 
| 21 | 
            -
              prerelease: false
         | 
| 22 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            -
                requirements:
         | 
| 24 | 
            -
                - - ">="
         | 
| 25 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '10.0'
         | 
| 27 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            -
              name: rspec
         | 
| 14 | 
            +
              name: bundler-audit
         | 
| 29 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 16 | 
             
                requirements:
         | 
| 31 17 | 
             
                - - ">="
         | 
| 32 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: ' | 
| 19 | 
            +
                    version: '0.6'
         | 
| 34 20 | 
             
              type: :development
         | 
| 35 21 | 
             
              prerelease: false
         | 
| 36 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 23 | 
             
                requirements:
         | 
| 38 24 | 
             
                - - ">="
         | 
| 39 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            -
                    version: ' | 
| 26 | 
            +
                    version: '0.6'
         | 
| 41 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            -
              name:  | 
| 28 | 
            +
              name: pry
         | 
| 43 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 30 | 
             
                requirements:
         | 
| 45 31 | 
             
                - - ">="
         | 
| 46 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: '0. | 
| 33 | 
            +
                    version: '0.12'
         | 
| 48 34 | 
             
              type: :development
         | 
| 49 35 | 
             
              prerelease: false
         | 
| 50 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 37 | 
             
                requirements:
         | 
| 52 38 | 
             
                - - ">="
         | 
| 53 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: '0. | 
| 40 | 
            +
                    version: '0.12'
         | 
| 55 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            -
              name:  | 
| 42 | 
            +
              name: rake
         | 
| 57 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 44 | 
             
                requirements:
         | 
| 59 45 | 
             
                - - ">="
         | 
| 60 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: '0 | 
| 47 | 
            +
                    version: '10.0'
         | 
| 62 48 | 
             
              type: :development
         | 
| 63 49 | 
             
              prerelease: false
         | 
| 64 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 51 | 
             
                requirements:
         | 
| 66 52 | 
             
                - - ">="
         | 
| 67 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: '0 | 
| 54 | 
            +
                    version: '10.0'
         | 
| 69 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            -
              name:  | 
| 56 | 
            +
              name: rspec
         | 
| 71 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 58 | 
             
                requirements:
         | 
| 73 59 | 
             
                - - ">="
         | 
| 74 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: ' | 
| 61 | 
            +
                    version: '3.8'
         | 
| 76 62 | 
             
              type: :development
         | 
| 77 63 | 
             
              prerelease: false
         | 
| 78 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 65 | 
             
                requirements:
         | 
| 80 66 | 
             
                - - ">="
         | 
| 81 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                    version: ' | 
| 68 | 
            +
                    version: '3.8'
         | 
| 83 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            -
              name:  | 
| 70 | 
            +
              name: rspec_junit_formatter
         | 
| 85 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 72 | 
             
                requirements:
         | 
| 87 73 | 
             
                - - ">="
         | 
| 88 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            -
                    version: '0. | 
| 75 | 
            +
                    version: '0.4'
         | 
| 90 76 | 
             
              type: :development
         | 
| 91 77 | 
             
              prerelease: false
         | 
| 92 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 79 | 
             
                requirements:
         | 
| 94 80 | 
             
                - - ">="
         | 
| 95 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            -
                    version: '0. | 
| 82 | 
            +
                    version: '0.4'
         | 
| 97 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 84 | 
             
              name: rubocop
         | 
| 99 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 86 | 
             
                requirements:
         | 
| 101 87 | 
             
                - - ">="
         | 
| 102 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: '0 | 
| 89 | 
            +
                    version: '1.0'
         | 
| 104 90 | 
             
              type: :development
         | 
| 105 91 | 
             
              prerelease: false
         | 
| 106 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 93 | 
             
                requirements:
         | 
| 108 94 | 
             
                - - ">="
         | 
| 109 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: '0 | 
| 96 | 
            +
                    version: '1.0'
         | 
| 111 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 112 98 | 
             
              name: simplecov
         | 
| 113 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -142,14 +128,14 @@ dependencies: | |
| 142 128 | 
             
                requirements:
         | 
| 143 129 | 
             
                - - "~>"
         | 
| 144 130 | 
             
                  - !ruby/object:Gem::Version
         | 
| 145 | 
            -
                    version: '0. | 
| 131 | 
            +
                    version: '0.7'
         | 
| 146 132 | 
             
              type: :runtime
         | 
| 147 133 | 
             
              prerelease: false
         | 
| 148 134 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 149 135 | 
             
                requirements:
         | 
| 150 136 | 
             
                - - "~>"
         | 
| 151 137 | 
             
                  - !ruby/object:Gem::Version
         | 
| 152 | 
            -
                    version: '0. | 
| 138 | 
            +
                    version: '0.7'
         | 
| 153 139 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 154 140 | 
             
              name: thin
         | 
| 155 141 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -203,7 +189,7 @@ homepage: https://github.com/bigcommerce/bc-prometheus-ruby | |
| 203 189 | 
             
            licenses:
         | 
| 204 190 | 
             
            - MIT
         | 
| 205 191 | 
             
            metadata: {}
         | 
| 206 | 
            -
            post_install_message:
         | 
| 192 | 
            +
            post_install_message: 
         | 
| 207 193 | 
             
            rdoc_options: []
         | 
| 208 194 | 
             
            require_paths:
         | 
| 209 195 | 
             
            - lib
         | 
| @@ -218,8 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 218 204 | 
             
                - !ruby/object:Gem::Version
         | 
| 219 205 | 
             
                  version: '0'
         | 
| 220 206 | 
             
            requirements: []
         | 
| 221 | 
            -
            rubygems_version: 3. | 
| 222 | 
            -
            signing_key:
         | 
| 207 | 
            +
            rubygems_version: 3.2.31
         | 
| 208 | 
            +
            signing_key: 
         | 
| 223 209 | 
             
            specification_version: 4
         | 
| 224 210 | 
             
            summary: Simple integration of ruby and puma servers with prometheus
         | 
| 225 211 | 
             
            test_files: []
         |