Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7136

Enable the tracing of lookup calls on a per-node basis

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Ready for Engineering
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: PUP 5.y
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Sub-team:
    • Team:
      Froyo
    • Story Points:
      3
    • Sprint:
      PDE 2017-04-05, PDE 2017-04-19, Language Triage
    • QA Risk Assessment:
      Needs Assessment

      Description

      Currently, one of the best tools for debugging a hiera() or lookup() call that isn't quite turning out right is to enable DEBUG level logging on the puppet server in order to get a trace of the files that were consulted when looking for a particular value:

      2017-01-26 18:25:56,037 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking up profile::rabbitmq::cluster_nodes in YAML backend
      2017-01-26 18:25:56,038 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking for data source nodes/test.cert
      2017-01-26 18:25:56,038 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Cannot find datafile hieradata/nodes/test.cert.yaml, skipping
      2017-01-26 18:25:56,038 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking for data source st02/rabbitmq
      2017-01-26 18:25:56,038 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Cannot find datafile hieradata/st02/rabbitmq.yaml, skipping
      2017-01-26 18:25:56,038 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking for data source st02
      2017-01-26 18:25:56,039 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Cannot find datafile hieradata/st02.yaml, skipping
      2017-01-26 18:25:56,039 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking for data source role/rabbitmq
      2017-01-26 18:25:56,039 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Cannot find datafile hieradata/role/rabbitmq.yaml, skipping
      2017-01-26 18:25:56,039 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Looking for data source common
      2017-01-26 18:25:56,039 DEBUG [qtp137565235-68] [puppetserver] Puppet hiera(): Cannot find datafile hieradata/common.yaml, skipping
      2017-01-26 18:25:56,044 ERROR [qtp137565235-68] [puppetserver] Puppet Evaluation Error: Error while evaluating a Function Call, Could not find data item profile::rabbitmq::cluster_nodes in any Hiera data file and no default supplied at /etc/puppetlabs/code/environments/st02/site/profile/manifests/rabbitmq/cluster.pp:2:30 on node test.cert
      

      This information can be compared against the configured hierarchy to deduce which values were in scope at the time that the lookup ran.

      There are however several downsides to this approach:

      • Boosting the logs to DEBUG level requires manual edits to config files and a puppet server restart.
      • DEBUG level output is generated for all agents, which absolutely kills the signal to noise ratio of the logs.
      • After debugging, the log level boost must be reverted via more manual edits and another restart.

      As a puppet operator, I would like the ability to temporarily enable lookup tracing for individual agent runs so that I can quickly debug misbehaving lookups running on the server without disruptions such as configuration edits or service restarts.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            chuck Charlie Sharpsteen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support