Module: FFWD::Plugin::GoogleCloud

Includes:
Logging, FFWD::Plugin
Defined in:
lib/ffwd/plugin/google_cloud/version.rb,
lib/ffwd/plugin/google_cloud/utils.rb,
lib/ffwd/plugin/google_cloud/hook.rb,
lib/ffwd/plugin/google_cloud.rb

Defined Under Namespace

Modules: Utils Classes: CallbackProxy, DebugRequest, Hook, SingleProxy

Constant Summary collapse

VERSION =
"0.4.7"
CUSTOM_PREFIX =
"custom.cloudmonitoring.googleapis.com"
DEFAULT_API_URL =
"https://www.googleapis.com"
DEFAULT_METADATA_URL =
"http://metadata.google.internal"
DEFAULT_SCOPE =
"https://www.googleapis.com/auth/monitoring"
DEFAULT_FLUSH_INTERVAL =
10
DEFAULT_BUFFER_LIMIT =
100
DEFAULT_DEBUG =
false

Class Method Summary collapse

Class Method Details

.setup_output(config) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/ffwd/plugin/google_cloud.rb', line 39

def self.setup_output config
  if not config[:project_id]
    raise "'project_id' is required"
  end

  if not config[:project]
    raise "'project' is required"
  end

  if not config[:client_id]
    raise "'client_id' is required"
  end

  config[:scope] ||= DEFAULT_SCOPE
  config[:metadata_url] ||= DEFAULT_METADATA_URL
  config[:api_url] ||= DEFAULT_API_URL
  config[:flush_interval] ||= DEFAULT_FLUSH_INTERVAL
  config[:buffer_limit] ||= DEFAULT_BUFFER_LIMIT
  # Fake all API interaction (output with log.debug)
  config[:debug] ||= DEFAULT_DEBUG

  hook = Hook.new(config)

  FFWD.flushing_output log, hook, config
end