ApplicationInsights-Ruby icon indicating copy to clipboard operation
ApplicationInsights-Ruby copied to clipboard

Success always false in TelemetryClient.track_request?

Open UpQuark opened this issue 5 years ago • 0 comments

Hi folks,

I noticed a little oddity while overriding code from telemetry_client.rb.

The ternary operator (full snippet below) seems to use = rather than == and so it seems like success will always be false. :success => success = nil ? true : success,

telemetry_client.rb

def track_request(id, start_time, duration, response_code, success, options={})
  data = Channel::Contracts::RequestData.new(
    :success => success = nil ? true : success,
    # etc ...
  )

  self.channel.write(data, self.context)
end

UpQuark avatar Aug 05 '19 17:08 UpQuark