Hi,
I'm proud to announce the immediate delivery of my Puppet Instrumentation
Framework (PIF for short).
I believe the patch has now reached the maturity needed to let it
live its own life in the Puppet ecosystem.
Architecture:
The PIF is composed of 3 elements:
* probes: they decorate a puppet method with instrumentation code
for a given label and data.
* the instrumentation listeners: those are observers of instrumentation
events for a given label (or all). Those are plugins that can be added
and enabled on demand. They are responsible to compute/maintain the
instrumentation data.
* the instrumentation middleware: it receives the instrumentation events
from the probes and broadcast those to the interested listeners.
The PIF adds 3 indirection usable through REST to control the framework:
* instrumentation_listeners: to list, enable or disable listeners
* instrumentation_data: to get access to the instrumentation data
* instrumentation_probe: to control the instrumentation probes
Usage:
1) Add this to your auth.conf:
path /instrumentation_listener
auth any
method find,search,save
allow *
path /instrumentation_data
auth any
method find
allow *
path /instrumentation_probe
auth any
allow *
2) Obviously launch your master
3) Enable the probes:
curl -k -H 'Accept: pson' -X PUT -H "Content-Type: text/pson" \
-d "{}" "https://localhost:8140/production/instrumentation_probe/all"
4) Enable the log listener to try it:
curl -k -H 'Accept: pson' -X PUT -H "Content-Type: text/pson" \
-d "{\"enabled\":true,\"name\":\"${name}\"}" \
"https://localhost:8140/production/instrumentation_listener/log"
5) let some client use the master
6) Get back some instrumentation data from the log listener:
curl -k -H 'Accept: pson'
"https://localhost:8140/production/instrumentation_data/log"
7) Enjoy
Things to know:
I only shipped 3 listeners, and nothing revolutionnary, my point was just to
provide the framework so that crazier people than me can do more crazy things.
I added only 4 probes to the puppet code (the 4 verbs of the indirector), as an
example
on how to set probes in the code.
There is no "puppet instrumentation" application (yet), as I believe the puppet
interface
system Luke designed would be the perfect way to control the instrumentation
system. Meanwhile, The PIF can be controlled through the REST interface with
resty
or curl (I have a bash script doing this available on request).
For the brave souls out there, the code is available there:
https://github.com/masterzen/puppet/tree/feature/instrumentation
As usual, comments, questions and flames are more than welcome,
Brice
Brice Figureau (8):
Instrumentation foundation layer
Add indirection (REST usable) to manipulate instrumentation
Add a way to add probe to puppet code
Add the example 'log' listener
Add the 'performance' instrumentation listener
Process name instrumentation listener
Add probe indirection for probe management
Example probes for the indirector
lib/puppet/application.rb | 3 +
lib/puppet/indirector/indirection.rb | 8 +
lib/puppet/indirector/instrumentation_data.rb | 3 +
.../indirector/instrumentation_data/local.rb | 19 ++
lib/puppet/indirector/instrumentation_data/rest.rb | 5 +
lib/puppet/indirector/instrumentation_listener.rb | 3 +
.../indirector/instrumentation_listener/local.rb | 20 +++
.../indirector/instrumentation_listener/rest.rb | 5 +
lib/puppet/indirector/instrumentation_probe.rb | 3 +
.../indirector/instrumentation_probe/local.rb | 24 +++
.../indirector/instrumentation_probe/rest.rb | 5 +
lib/puppet/util/instrumentation.rb | 150 +++++++++++++++++
lib/puppet/util/instrumentation/Instrumentable.rb | 137 ++++++++++++++++
lib/puppet/util/instrumentation/data.rb | 28 +++
.../util/instrumentation/indirection_probe.rb | 24 +++
lib/puppet/util/instrumentation/listener.rb | 53 ++++++
lib/puppet/util/instrumentation/listeners/log.rb | 24 +++
.../util/instrumentation/listeners/performance.rb | 28 +++
.../util/instrumentation/listeners/process_name.rb | 103 ++++++++++++
spec/unit/application_spec.rb | 6 +
.../indirector/instrumentation_data/local_spec.rb | 52 ++++++
.../indirector/instrumentation_data/rest_spec.rb | 12 ++
.../instrumentation_listener/local_spec.rb | 58 +++++++
.../instrumentation_listener/rest_spec.rb | 12 ++
.../indirector/instrumentation_probe/local_spec.rb | 64 +++++++
.../indirector/instrumentation_probe/rest_spec.rb | 12 ++
spec/unit/util/instrumentation/data_spec.rb | 37 ++++
.../util/instrumentation/instrumentable_spec.rb | 173 ++++++++++++++++++++
spec/unit/util/instrumentation/listener_spec.rb | 83 ++++++++++
.../util/instrumentation/listeners/log_spec.rb | 35 ++++
.../instrumentation/listeners/performance_spec.rb | 37 ++++
.../instrumentation/listeners/process_name_spec.rb | 169 +++++++++++++++++++
spec/unit/util/instrumentation_spec.rb | 127 ++++++++++++++
33 files changed, 1522 insertions(+), 0 deletions(-)
create mode 100644 lib/puppet/indirector/instrumentation_data.rb
create mode 100644 lib/puppet/indirector/instrumentation_data/local.rb
create mode 100644 lib/puppet/indirector/instrumentation_data/rest.rb
create mode 100644 lib/puppet/indirector/instrumentation_listener.rb
create mode 100644 lib/puppet/indirector/instrumentation_listener/local.rb
create mode 100644 lib/puppet/indirector/instrumentation_listener/rest.rb
create mode 100644 lib/puppet/indirector/instrumentation_probe.rb
create mode 100644 lib/puppet/indirector/instrumentation_probe/local.rb
create mode 100644 lib/puppet/indirector/instrumentation_probe/rest.rb
create mode 100644 lib/puppet/util/instrumentation.rb
create mode 100644 lib/puppet/util/instrumentation/Instrumentable.rb
create mode 100644 lib/puppet/util/instrumentation/data.rb
create mode 100644 lib/puppet/util/instrumentation/indirection_probe.rb
create mode 100644 lib/puppet/util/instrumentation/listener.rb
create mode 100644 lib/puppet/util/instrumentation/listeners/log.rb
create mode 100644 lib/puppet/util/instrumentation/listeners/performance.rb
create mode 100644 lib/puppet/util/instrumentation/listeners/process_name.rb
create mode 100644 spec/unit/indirector/instrumentation_data/local_spec.rb
create mode 100644 spec/unit/indirector/instrumentation_data/rest_spec.rb
create mode 100644 spec/unit/indirector/instrumentation_listener/local_spec.rb
create mode 100644 spec/unit/indirector/instrumentation_listener/rest_spec.rb
create mode 100644 spec/unit/indirector/instrumentation_probe/local_spec.rb
create mode 100644 spec/unit/indirector/instrumentation_probe/rest_spec.rb
create mode 100644 spec/unit/util/instrumentation/data_spec.rb
create mode 100644 spec/unit/util/instrumentation/instrumentable_spec.rb
create mode 100644 spec/unit/util/instrumentation/listener_spec.rb
create mode 100644 spec/unit/util/instrumentation/listeners/log_spec.rb
create mode 100644 spec/unit/util/instrumentation/listeners/performance_spec.rb
create mode 100644
spec/unit/util/instrumentation/listeners/process_name_spec.rb
create mode 100644 spec/unit/util/instrumentation_spec.rb
--
1.7.2.1
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.