Class: Prometheus::Client::Rack::Exporter
- Inherits:
-
Object
- Object
- Prometheus::Client::Rack::Exporter
- Defined in:
- lib/prometheus/client/rack/exporter.rb
Constant Summary collapse
- API_VERSION =
'0.0.2'
- CONTENT_TYPE =
'application/json; schema="prometheus/telemetry"; version=' + API_VERSION
- HEADERS =
{ 'Content-Type' => CONTENT_TYPE }
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#registry ⇒ Object
readonly
Returns the value of attribute registry.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/prometheus/client/rack/exporter.rb', line 7 def app @app end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/prometheus/client/rack/exporter.rb', line 7 def path @path end |
#registry ⇒ Object (readonly)
Returns the value of attribute registry.
7 8 9 |
# File 'lib/prometheus/client/rack/exporter.rb', line 7 def registry @registry end |
Instance Method Details
#call(env) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/prometheus/client/rack/exporter.rb', line 19 def call(env) if env['PATH_INFO'] == @path metrics_response else @app.call(env) end end |