Skip to content

Instantly share code, notes, and snippets.

@masterzen
Created January 28, 2012 19:54
Show Gist options
  • Save masterzen/1695574 to your computer and use it in GitHub Desktop.
Save masterzen/1695574 to your computer and use it in GitHub Desktop.
Puppet intrumentation framework
# Puppet Instrumentation Framework
#
# * probes are code bits that trigger events to the framework
# * listeners receive those events and do what they want. Listeners can
# be subscribed to some events types only.
#
# Currently 4 probes:
# * indirector find
# * indirector save
# * indirector search
# * indirector remove
#
# Currently 3 listeners
# * log: logs every probe call
# * performance: aggregate probe run time
# * process name: display the last probe called in the process table
# Add authorization to auth.conf
path /instrumentation
auth any
allow 127.0.0.1
# list probes
curl -k -H 'Accept: pson' "https://puppet:8140/production/instrumentation_probes/all"
# enable probes
curl -k -H 'Accept: pson' -X PUT -H "Content-Type: text/pson" -d "{}" \
"https://puppet:8140/production/instrumentation_probe/all"
# enable performance listener (this is on one line)
curl -k -H 'Accept: pson' -X PUT -H "Content-Type: text/pson" -d "{\"document_type\":\"Puppet::Util::Instrumentation::Listener\",\"data\":{\"enabled\":true,\"name\":\"performance\"}}" "https://puppet:8140/production/instrumentation_listener/performance"
# list all the listeners
curl -k -H 'Accept: pson' "https://puppet:8140/production/instrumentation_listeners/all"
# get data from the performance listener:
curl -k -H 'Accept: pson' "https://puppet:8140/production/instrumentation_data/performance"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment