Docs: Formats: Reports


Formats: Reports

Puppet 3.6 uses report format 4.

Report Format 4

This is the format of reports output by Puppet versions 3.3.0 and later. It is backwards-compatible with report format 3, as it only adds two fields.

Starting with Puppet 3.3.0, report objects being sent to the puppet master can be serialized as pson (a variant of json that allows byte sequences that aren’t valid utf-8 characters). This is a change from Puppet 3.2.4 and earlier, which only allowed reports to be serialized as yaml. The report serialization format can be changed for compatibility with older puppet masters with the report_serialization_format setting.

Puppet::Transaction::Report

The Puppet::Transaction::Report contains the following attributes:

nametypedescription
hoststringthe host that generated this report.
timedatetimewhen the run began.
logsarray0 or more Puppet::Util::Log objects.
metricshashmaps from string (metric category) to Puppet::Util::Metric.
resource_statuseshashmaps from resource name to Puppet::Resource::Status
configuration_versionstring or integerThe "configuration version" of the puppet run. This is a string if the user has specified their own versioning scheme, otherwise an integer representing seconds since the epoch.
transaction_uuidstringA UUID covering the transaction. The query parameters for the catalog retrieval will have included the same UUID.
report_formatinteger4
puppet_versionstringThe version of the Puppet agent.
kindstring"inspect" if this report came from a "puppet inspect" run, "apply" if it came from a "puppet apply" or "puppet agent" run.
statusstring"failed", "changed", or "unchanged"
environmentstringThe environment that was used for the puppet run.

Puppet::Util::Log

A Puppet::Util::Log object contains the following attributes:

nametypedescription
filestringthe pathname of the manifest file which triggered the log message.
lineintegerthe line number in the manifest file which triggered the log message.
levelsymbolseverity of the message. Possible values for level are :debug, :info, :notice, :warning, :err, :alert, :emerg, :crit
messagestringthe message itself.
sourcestringthe origin of the log message. This could be a resource, a property of a resource, or the string "Puppet".
tagsarrayeach array element is a string.
timedatetimewhen the message was sent.

The file and line attributes are not always present.

Puppet::Util::Metric

A Puppet::Util::Metric object represents all the metrics in a single category. It contains the following attributes:

nametypedescription
namestringname of the metric category. This is the same as the key associated with this metric in the metrics hash of the Puppet::Transaction::Report.
labelstringThis is the "titleized" version of the name, which means underscores are replaced with spaces and the first word is capitalized.
valuesarrayAll the metric values within this category. Each element is of the form [name, titleized_name, value], where name is the name of the particular metric as a string, titleized_name is the "titleized" string of the name, and value is the quantity (an integer or a float).

The set of particular metrics and categories which appear in a report is a fixed set. In a successful report, the categories and metrics are:

  • In the time category, there is a metric for every resource type for which there is at least one resource in the catalog, plus two additional metrics, called config_retrieval and total. Each value in the time category is a float.
  • In the resources category, the metrics are failed, out_of_sync, changed, and total. Each value in the resources category is an integer.
  • In the events category, there are up to five metrics: success, failure, audit, noop, and total. total is always present; the others are only present when their values are non-zero. Each value in the events category is an integer.
  • In the changes category, there is only one metric, called total. Its value is an integer.

Failed reports contain no metrics.

In an inspect report, there is an additional inspect metric in the time category.

Puppet::Resource::Status

A Puppet::Resource::Status object represents the status of a single resource. It contains the following attributes:

nametypedescription
resource_typestringthe resource type, capitalized.
titletitlethe resource title.
resourcestringthe resource name, in the form Type[title]. This is always the same as the key corresponding to this Puppet::Resource::Status object in the resource_statuses hash. *deprecated*
filestringthe pathname of the manifest file which declared the resource
lineintegerthe line number in the manifest file which declared the resource
evaluation_timefloatthe amount of time, in seconds, taken to evaluate the resource. Not present in inspect reports.
change_countintegerthe number of properties which changed. Always 0 in inspect reports.
out_of_sync_countintegerthe number of properties which were out of sync. Always 0 in inspect reports.
tagsarraythe strings with which the resource is tagged
timedatetimethe time at which the resource was evaluated
eventsarraythe Puppet::Transaction::Event objects for the resource
out_of_syncbooleanTrue if out_of_sync_count > 0, otherwise false. *deprecated*
changedbooleanTrue if change_count > 0, otherwise false. *deprecated*
skippedbooleanTrue if the resource was skipped, otherwise false.
failedbooleanTrue if Puppet experienced an error while evaluating this resource, otherwise false. *deprecated*
containment_patharrayAn array of strings; each element represents a container (type or class) that, together, make up the path of the resource in the catalog.

Puppet::Transaction::Event

A Puppet::Transaction::Event object represents a single event for a single resource. It contains the following attributes:

nametypedescription
auditedbooleantrue if this property is being audited, otherwise false. True in inspect reports.
propertystringthe property for which the event occurred. This value will be missing if the provider errored out before it could be determined.
previous_valuestring, array, or hashthe value of the property before the change (if any) was applied. This value will be missing if the provider errored out before it could be determined.
desired_valuestring, array, or hashthe value specified in the manifest. Absent in inspect reports. This value will be missing if the provider errored out before it could be determined.
historical_valuestring, array, or hashthe audited value from a previous run of Puppet, if known. Otherwise nil. Absent in inspect reports. This value will be missing if the provider errored out before it could be determined.
messagestringthe log message generated by this event
namesymbolthe name of the event. Absent in inspect reports.
statusstringone of the following strings: "success", "failure", "noop", "audit", depending on the type of the event (see below). Always "audit" in inspect reports.
timedatetimethe time at which the property was evaluated

Puppet::Transaction::Event#status has the following meanings:

  • success: property was out of sync, and was successfully changed to be in sync.
  • failure: property was out of sync, and couldn’t be changed to be in sync due to an error.
  • noop: property was out of sync, and wasn’t changed due to noop mode.
  • audit: property was in sync, and was being audited.

Differences from Report Format 3

  • Puppet::Transaction::Report gained transaction_uuid.
  • Puppet::Resource::Status gained containment_path.

↑ Back to top