Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Python
branch: master

This branch is 30 commits ahead, 2 commits behind klmitch:master

etc/ doesn't work reliably on all versions of distribute

At least on distribute 0.6.24, it can't find etc/ with the error message:

warning: no directories found matching 'etc/'

Without the trailing / all versions of distribute I tested work
latest commit 9f35936166
@jerdfelt jerdfelt authored
Failed to load latest commit information.
bin make it pretty
etc whoops
other Added actual configs for the examples and moved the example directory…
tach
tests extra test
.gitignore Ignore *.pyc files
MANIFEST.in etc/ doesn't work reliably on all versions of distribute
README.md The installation mechanics prevented you from instrumenting the same …
setup.py Adding MANIFEST.in

README.md

Tach

Example instrumentation:

For the NovaAPI, using the OpenstackAPI, created in tach-api.conf

[global]
# also accepts a full path to the file, instead of a python module path
app_helper = tach_helper

[notifier:statsd]
driver = tach.notifiers.StatsDNotifier
host = <Your statsd host>
port = <Your statsd port, probably 8125>

[nova.api.openstack.api]
module = nova.api.openstack.wsgi.Resource
method = _process_stack
metric = tach.metrics.ExecTime
notifier = statsd
app_path = tach_helper
app = process_stack

Set up the helper script, created in tach_helper.py

This is where things get a little messy, but that's the catch with trying to instrument something you don't want to modify directly...

# create this in a file called tach_helper.py in the same directory as the conf
def queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.compute.%s" % method

def network_queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.network.%s" % method

def scheduler_queue_receive(*args, **kwargs):
    method = args[2]
    return args, kwargs, "nova.scheduler.%s" % method

def process_stack(*args, **kwargs):
    resource = args[0]
    req = args[1].__dict__
    method = ".%s" % req['environ']['REQUEST_METHOD']
    path = '.%s' % req['environ']['PATH_INFO'].split('/')[2]
    action = ".%s" % req['environ']['wsgiorg.routing_args'][1]['action']
    if action:
        key = 'nova.api%s%s%s' % (path, action, method)
    else:
        key = 'nova.api%s%s%s' % (path, method)
    return args, kwargs, key

Finally, launch the above

# Assumes you're in the nova dir already
tach tach-api.conf ./bin/nova-api
tach tach-compute.conf ./bin/nova-compute
tach tach-scheduler.conf ./bin/nova-scheduler
tach tach-network.conf ./bin/nova-network
Something went wrong with that request. Please try again.