Class: RooOnRails::Checks::Heroku::MetricsBridgeConfigured

Inherits:
EnvSpecific
  • Object
show all
Defined in:
lib/roo_on_rails/checks/heroku/metrics_bridge_configured.rb

Overview

Checks that the Heroku-Datadog metrics bridge is configured to accept logs from the app.

Input context

  • heroku.api_client: a connected PlatformAPI client

  • heroku.app.EnvSpecific#env: an existing app name.

Output context:

  • heroku.metric_bridge_token.EnvSpecific#env: the password for the metrics bridge

Constant Summary collapse

BRIDGE_APP =
'roo-dd-bridge-production'.freeze

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



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/roo_on_rails/checks/heroku/metrics_bridge_configured.rb', line 28

def call
  config = current_config
  names = config[app_list_var].split(',')

  fail! 'Bridge does not allow this app'        unless names.include? app_name
  fail! 'Bridge lacks credentials for this app' unless config[token_var]
  fail! 'Bridge lacks tags for this app'        unless config[tags_var]

  pass "Bridge is configured for #{bold app_name}"
  context.heroku.metric_bridge_token![env] = config[token_var]
end

#introObject



24
25
26
# File 'lib/roo_on_rails/checks/heroku/metrics_bridge_configured.rb', line 24

def intro
  'Checking whether metrics bridge is configured...'
end