Sha256: ad58e32fb9506d1a0f110da12c0ce537ee8ccccefb47a816d01ef59955226392

Contents?: true

Size: 731 Bytes

Versions: 210

Compression:

Stored size: 731 Bytes

Contents

require 'prometheus/client/simple_value'

module Prometheus
  module Client
    # Module providing convenience methods for creating value_object
    module UsesValueType
      def value_class
        Prometheus::Client.configuration.value_class
      end

      def value_object(type, metric_name, name, labels, *args)
        value_class.new(type, metric_name, name, labels, *args)
      rescue StandardError => e
        Prometheus::Client.logger.info("error #{e} while creating instance of #{value_class} defaulting to SimpleValue")
        Prometheus::Client.logger.debug("error #{e} backtrace #{e.backtrace.join("\n")}")
        Prometheus::Client::SimpleValue.new(type, metric_name, name, labels)
      end
    end
  end
end

Version data entries

210 entries across 210 versions & 2 rubygems

Version Path
prometheus-client-mmap-1.1.2 lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.1.2-x86_64-linux lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.1.2-x86_64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.1.2-arm64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.1.2-aarch64-linux lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6 lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-x86_64-linux-musl lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-x86_64-linux-gnu lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-x86_64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-arm64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-aarch64-linux-musl lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.6-aarch64-linux-gnu lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5 lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-x86_64-linux-musl lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-x86_64-linux-gnu lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-x86_64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-arm64-darwin lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-aarch64-linux-musl lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.5-aarch64-linux-gnu lib/prometheus/client/uses_value_type.rb
prometheus-client-mmap-1.2.4 lib/prometheus/client/uses_value_type.rb