Skip to content

Silent Failures When Batching Tracking Events #178

@willisplummer

Description

@willisplummer

Hi, I've tried a number of versions from 2.0.0 through 2.2.5 and consistently experience silent failures when firing a number of events at once

client = Segment::Analytics.new({
  write_key: ENV['SEGMENT_KEY'],
  on_error: proc { |_status, msg| print }
})

20.times do
  puts client.track(user_id: 12, event: '2121', properties: {})
end

client.flush

the loop returns true 20 times

when i look in the segment debugger, i only see 10-15 events actually reaching segment. i've tried without the flush and get basically the same result.

at this point it seems like i'll need to switch to simple_segment and enqueue the tracking events in background jobs?

(running rails 5.1.0 and ruby 2.3.1)

thanks in advance!

edit:

tried with 2.2.6.pre and it's closer to working but i still inconsistently get 19 instead of 20 events even when running

20.times do
  puts client.track(user_id: 12, event: '2121', properties: {})
  client.flush
end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions