Class: RooOnRails::Checks::Heroku::DrainsMetrics

Inherits:
EnvSpecific show all
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

#env

Instance Method Summary collapse

Methods inherited from EnvSpecific

#initialize, #signature

Methods inherited from Base

#initialize, requires, #run

Methods included from RooOnRails::Checks::Helpers

#bold, included

Constructor Details

This class inherits a constructor from RooOnRails::Checks::EnvSpecific

Instance Method Details

#callObject



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

#introObject



20
21
22
# File 'lib/roo_on_rails/checks/heroku/drains_metrics.rb', line 20

def intro
  'Checking for metrics drain...'
end