diff options
author | Adam Leff <adam@leff.co> | 2016-05-18 14:32:33 -0400 |
---|---|---|
committer | Adam Leff <adam@leff.co> | 2016-06-02 15:09:59 -0400 |
commit | e3039ee388b5a5f9dd6a90f74adc9a4bcf1eec8a (patch) | |
tree | 38bbbd424a002884cfa353c6144016cd7e63bd2d /lib/chef/client.rb | |
parent | fe86dd1a371ec3aaaa9b2aff9910602070d5eeac (diff) | |
download | chef-e3039ee388b5a5f9dd6a90f74adc9a4bcf1eec8a.tar.gz |
Creation of the new DataCollector reporter
The DataCollector reporter is a new method for exporting data about your
Chef run. The details of this new feature can be found in
[RFC 077](https://github.com/chef/chef-rfc/blob/master/rfc077-mode-agnostic-data-collection.md).
Using the existing `EventDispatch` mechanics, the DataCollector reporter
collects data about a Chef run (when it starts, when it ends, what
resources were modified, etc.) and then POSTs them to a Data Collector
server URL that can be specified in your Chef configuration.
While similar functionality exists using the `ResourceReporter` and Chef
Reporting, a new implementation was done to decouple the reporting of this
data from requiring the use of a Chef Server (in the case of Chef Reporting),
opening the door to users being able to implement their own webhook-style
receiver to receive these messages and analyze them accordingly.
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r-- | lib/chef/client.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 054b284bd5..c857da1b93 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -45,6 +45,7 @@ require "chef/formatters/doc" require "chef/formatters/minimal" require "chef/version" require "chef/resource_reporter" +require "chef/data_collector" require "chef/audit/audit_reporter" require "chef/run_lock" require "chef/policy_builder" @@ -263,6 +264,7 @@ class Chef run_ohai register unless Chef::Config[:solo_legacy_mode] + register_data_collector_reporter load_node @@ -957,6 +959,12 @@ class Chef Chef::ReservedNames::Win32::Security.has_admin_privileges? end + + # Register the data collector reporter to send event information to the + # data collector server + def register_data_collector_reporter + events.register(Chef::DataCollector::Reporter.new) if Chef::DataCollector.register_reporter? + end end end |