DESCRIPTION:

A simple chef report handler that uses the stackdriver gem to send Chef run information to Stackdriver using custom application metrics. 3 custom metrics are created:

chef_status - 1 on success. 0 on failure. chef_run_time - Length of time for chef_run in seconds. Only sent on success. chef_resources_updated - Number of resources updated. Only sent on success.

Inspired by the Mail handler gem at http://github.com/kisoku/chef-handler-mail

USAGE:

Using /etc/chef/config.rb

require 'rubygems'
require 'chef/handler/stackdriver'

stackdriver_handler = StackDriverHandler.new
report_handlers << stackdriver_handler
exception_handlers << stackdriver_handler

Using chef_handler LWRP

chef_gem 'chef-handler-stackdriver'

chef_handler 'StackDriverHandler' do
   source 'chef/handler/stackdriver'
   arguments (
    :instance_id => node[:ec2][:instance_id],
    :stackdriver_api => node[:stackdriver][:api]
   )
   action :nothing
end.run_action(:enable)

LICENSE AND AUTHOR:

Author:: Table XI ([email protected])

Copyright:: 2014, Table XI

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.