Class: PrometheusExporter::LocalClient

Inherits:
Client
  • Object
show all
Defined in:
lib/prometheus_exporter/client.rb

Constant Summary

Constants inherited from Client

Client::MAX_QUEUE_SIZE, Client::MAX_SOCKET_AGE

Instance Attribute Summary collapse

Attributes inherited from Client

#logger

Instance Method Summary collapse

Methods inherited from Client

#custom_labels=, default, default=, #find_registered_metric, #process_queue, #register, #send_json, #stop

Constructor Details

#initialize(collector:, json_serializer: nil, custom_labels: nil) ⇒ LocalClient

Returns a new instance of LocalClient.



277
278
279
280
# File 'lib/prometheus_exporter/client.rb', line 277

def initialize(collector:, json_serializer: nil, custom_labels: nil)
  @collector = collector
  super(json_serializer: json_serializer, custom_labels: custom_labels)
end

Instance Attribute Details

#collectorObject (readonly)

Returns the value of attribute collector.



275
276
277
# File 'lib/prometheus_exporter/client.rb', line 275

def collector
  @collector
end

Instance Method Details

#send(json) ⇒ Object



282
283
284
# File 'lib/prometheus_exporter/client.rb', line 282

def send(json)
  @collector.process(json)
end