Skip to content

Conversation

rohitpaulk
Copy link
Collaborator

@rohitpaulk rohitpaulk commented May 19, 2018

  • Prefix all logs with [analytics-ruby]. Although we could override progname for this, it isn't really visible in all logging systems, and depends on the formatter used
  • Emit a debug log for the number of items sent in a batch
  • Emit a debug log when a request is retried

@codecov-io
Copy link

codecov-io commented May 19, 2018

Codecov Report

Merging #163 into master will decrease coverage by 0.17%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
- Coverage   98.58%   98.41%   -0.18%     
==========================================
  Files          11       11              
  Lines         425      441      +16     
==========================================
+ Hits          419      434      +15     
- Misses          6        7       +1
Impacted Files Coverage Δ
lib/segment/analytics/request.rb 100% <100%> (ø) ⬆️
lib/segment/analytics/worker.rb 100% <100%> (ø) ⬆️
lib/segment/analytics/logging.rb 90.62% <89.47%> (+1.15%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aedabe9...c52c386. Read the comment docs.

@rohitpaulk rohitpaulk merged commit 59858b9 into master May 19, 2018
@rohitpaulk rohitpaulk deleted the better-logging branch May 19, 2018 17:24
@@ -44,6 +45,7 @@ def run
end
end

logger.debug("Sending request for #{@batch.length} items")
res = @request.post(@write_key, @batch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @rohitpaulk, as a follow up; let's log the result of the HTTP response. I think the status code might be helpful to have here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants