lib/gruf/prometheus/configuration.rb
##
# Set the default configuration onto the extended class
#
Set the default configuration onto the extended class
Set the default configuration onto the extended class
def reset
        VALID_CONFIG_KEYS.each do |k, v|
          send("#{k}=".to_sym, v)
        end
        self.process_label = ENV.fetch('PROMETHEUS_PROCESS_LABEL', 'grpc').to_s
        self.process_name = ENV.fetch('PROMETHEUS_PROCESS_NAME', 'grpc').to_s
        self.collection_frequency = ENV.fetch('PROMETHEUS_COLLECTION_FREQUENCY', 30).to_i
        self.server_measure_latency = ENV.fetch('PROMETHEUS_SERVER_MEASURE_LATENCY', 0).to_i.positive?
        self.client_measure_latency = ENV.fetch('PROMETHEUS_CLIENT_MEASURE_LATENCY', 0).to_i.positive?
      end
def reset VALID_CONFIG_KEYS . each do | k , v | send ( "#{k}=" . to_sym , v ) end self . process_label = ENV . fetch ( 'PROMETHEUS_PROCESS_LABEL' , 'grpc' ) . to_s self . process_name = ENV . fetch ( 'PROMETHEUS_PROCESS_NAME' , 'grpc' ) . to_s self . collection_frequency = ENV . fetch ( 'PROMETHEUS_COLLECTION_FREQUENCY' , 30 ) . to_i self . server_measure_latency = ENV . fetch ( 'PROMETHEUS_SERVER_MEASURE_LATENCY' , 0 ) . to_i . positive? self . client_measure_latency = ENV . fetch ( 'PROMETHEUS_CLIENT_MEASURE_LATENCY' , 0 ) . to_i . positive? end
Set the default configuration onto the extended class
Set the default configuration onto the extended class