Class: Fluent::PrometheusInput
- Inherits:
-
Input
- Object
- Input
- Fluent::PrometheusInput
- Defined in:
- lib/fluent/plugin/in_prometheus.rb
Defined Under Namespace
Classes: MonitorServlet
Instance Attribute Summary collapse
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ PrometheusInput
constructor
A new instance of PrometheusInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ PrometheusInput
Returns a new instance of PrometheusInput.
15 16 17 18 |
# File 'lib/fluent/plugin/in_prometheus.rb', line 15 def initialize super @registry = ::Prometheus::Client.registry end |
Instance Attribute Details
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
13 14 15 |
# File 'lib/fluent/plugin/in_prometheus.rb', line 13 def registry @registry end |
Instance Method Details
#configure(conf) ⇒ Object
20 21 22 |
# File 'lib/fluent/plugin/in_prometheus.rb', line 20 def configure(conf) super end |
#shutdown ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fluent/plugin/in_prometheus.rb', line 37 def shutdown super if @server @server.shutdown @server = nil end if @thread @thread.join @thread = nil end end |
#start ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fluent/plugin/in_prometheus.rb', line 24 def start super @server = WEBrick::HTTPServer.new( BindAddress: @bind, Port: @port, MaxClients: 5, Logger: WEBrick::Log.new(STDERR, WEBrick::Log::FATAL), AccessLog: [], ) @server.mount(@metrics_path, MonitorServlet, self) @thread = Thread.new { @server.start } end |