Class: RooOnRails::Checks::Heroku::DrainsMetrics
- Inherits:
-
EnvSpecific
- Object
- Base
- EnvSpecific
- RooOnRails::Checks::Heroku::DrainsMetrics
- Defined in:
- lib/roo_on_rails/checks/heroku/drains_metrics.rb
Overview
Checks that the app is configured to send its logs to the Heroku-Datadog metrics bridge.
Input context
-
heroku.api_client: a connected PlatformAPI client
-
heroku.app.EnvSpecific#env: an existing app name.
-
heroku.metric_bridge_token.EnvSpecific#env: the password for the metrics bridge
Instance Attribute Summary
Attributes inherited from EnvSpecific
Instance Method Summary collapse
Methods inherited from EnvSpecific
Methods inherited from Base
Methods included from RooOnRails::Checks::Helpers
Constructor Details
This class inherits a constructor from RooOnRails::Checks::EnvSpecific
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/roo_on_rails/checks/heroku/drains_metrics.rb', line 24 def call url = client.log_drain.list(app_name). map { |h| h['url'] }. find { |u| u.include? MetricsBridgeConfigured::BRIDGE_APP } fail! 'No matching drain found' if url.nil? final_fail! 'Misconfigured drain found' if url != drain_uri pass "Drain is connected to #{bold app_name}" end |
#intro ⇒ Object
20 21 22 |
# File 'lib/roo_on_rails/checks/heroku/drains_metrics.rb', line 20 def intro 'Checking for metrics drain...' end |