-
-
Save rkoster/7546242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Bosh::OpenStackCloud | |
class ExconLoggingInstrumentor | |
REDACTED = "[REDACTED]" | |
def self.instrument(name, params = {}, &block) | |
params = params.dup | |
if params.has_key?(:headers) && params[:headers].has_key?('Authorization') | |
params[:headers] = params[:headers].dup | |
params[:headers]['Authorization'] = REDACTED | |
end | |
if params.has_key?(:password) | |
params[:password] = REDACTED | |
end | |
Bosh::Clouds::Config.logger.debug("#{name} #{params.inspect}") | |
if block_given? | |
yield | |
end | |
end | |
end | |
end | |
# And add this value to openstack_params | |
# at https://github.com/cloudfoundry/bosh/blob/master/bosh_openstack_cpi/lib/cloud/openstack/cloud.rb#L45 | |
# and https://github.com/cloudfoundry/bosh/blob/master/bosh_openstack_cpi/lib/cloud/openstack/cloud.rb#L61 | |
:connection_options => {:instrumentor => Bosh::OpenStackCloud::ExconLoggingInstrumentor} | |
# Also make sure to require the above file | |
# at https://github.com/cloudfoundry/bosh/blob/master/bosh_openstack_cpi/lib/cloud/openstack.rb#L33 | |
require "cloud/openstack/excon_logging_instrumentor" | |
# After restarting the director (when inline editing), the log can be viewed by: | |
# bosh task {task_id} --debug | grep excon\\. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment