Skip to content

Commit

Permalink
Add logging to external services
Browse files Browse the repository at this point in the history
  • Loading branch information
jrothrock committed Mar 23, 2023
1 parent 2ffc40a commit 5274c0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/scout_apm/instruments/http.rb
Expand Up @@ -52,6 +52,7 @@ def request_scout_description(verb, uri)

module HTTPInstrumentationPrepend
def request(verb, uri, opts = {})
logger.info "ESMETRICS - URI: #{uri}"
self.class.instrument("HTTP", verb, :ignore_children => true, :desc => request_scout_description(verb, uri)) do
super(verb, uri, opts)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/scout_apm/instruments/http_client.rb
Expand Up @@ -55,6 +55,8 @@ def request(*args, &block)
method = args[0].to_s
url = args[1]

logger.info "ESMETRICS - URL: #{url}"

max_length = ScoutApm::Agent.instance.context.config.value('instrument_http_url_length')
url = url && url.to_s[0..(max_length - 1)]

Expand Down
Expand Up @@ -48,6 +48,7 @@ def skip_layer?(layer)
def domain_name(layer)
domain = ""
desc_str = layer.desc.to_s
context.logger.info("ESMETRICS desc - #{desc_str}")
desc_str = 'http://' + desc_str unless desc_str =~ /^http/i
domain = URI.parse(desc_str).host
rescue
Expand Down

0 comments on commit 5274c0d

Please sign in to comment.