mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|elb] Add instrumentation support.
This commit is contained in:
parent
6cecc5f0a9
commit
542bfc4dea
1 changed files with 14 additions and 2 deletions
|
@ -16,7 +16,7 @@ module Fog
|
|||
class ValidationError < Fog::Errors::Error; end
|
||||
|
||||
requires :aws_access_key_id, :aws_secret_access_key
|
||||
recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at
|
||||
recognizes :region, :host, :path, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :instrumentor, :instrumentor_name
|
||||
|
||||
request_path 'fog/aws/requests/elb'
|
||||
request :configure_health_check
|
||||
|
@ -125,7 +125,9 @@ module Fog
|
|||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
@connection_options = options[:connection_options] || {}
|
||||
|
||||
@instrumentor = options[:instrumentor]
|
||||
@instrumentor_name = options[:instrumentor_name] || 'fog.aws.elb'
|
||||
|
||||
options[:region] ||= 'us-east-1'
|
||||
@host = options[:host] || "elasticloadbalancing.#{options[:region]}.amazonaws.com"
|
||||
@path = options[:path] || '/'
|
||||
|
@ -169,6 +171,16 @@ module Fog
|
|||
}
|
||||
)
|
||||
|
||||
if @instrumentor
|
||||
@instrumentor.instrument("#{@instrumentor_name}.request", params) do
|
||||
_request(body, idempotent, parser)
|
||||
end
|
||||
else
|
||||
_request(body, idempotent, parser)
|
||||
end
|
||||
end
|
||||
|
||||
def _request(body, idempotent, parser)
|
||||
@connection.request({
|
||||
:body => body,
|
||||
:expects => 200,
|
||||
|
|
Loading…
Reference in a new issue