This release sends an X-Retry-Count request header on retries. If your
traffic to Segment goes through a proxy, gateway or WAF that allowlists
request headers, add it before upgrading or retried uploads will be
rejected. The Authorization header is unchanged: this client has always
sent the write key as HTTP Basic credentials.
- Send
X-Retry-Counton retries, so the server can distinguish a retry from a first attempt. Omitted on the first attempt. - Unified retry handling: 429, 408, 410, 460 and 5xx (except 501, 505 and 511) are retried.
Retry-Afteris honoured on all of them, not just 429, which brings 529 in through the generic 5xx rule. Retry-Afteraccepts numeric seconds and the RFC 7231 HTTP-date formats, capped at 300s (rate_limit_retry_after_cap).- Rate-limited retries are bounded by elapsed time rather than counted against the retry limit, so a long
Retry-Afterno longer exhausts the budget. - New options
max_total_backoff_durationandmax_rate_limit_duration(default 12 hours each) bound the two waits. - Only 2xx responses count as a successful upload. A 3xx is now reported as a failed upload rather than silently treated as delivered. It is not retried: a redirect
Net::HTTPalready declined to follow will not succeed on a retry. The Segment endpoint does not redirect, so this only affects customhostvalues. - Network errors are retried on the same backoff schedule as failed responses instead of dropping the batch.
- Backoff waits no longer block shutdown for the full delay.
- Retry timing uses a monotonic clock, so a system clock change cannot stretch or collapse a backoff.
- Backoff intervals are now jittered at the ceiling as well, so clients that back off together do not retry in lockstep.
- Default backoff pacing changed: the base wait is 500ms (was 100ms), the ceiling is 60s (was 10s), and the multiplier is 2 (was 1.5). This aligns ruby with the other Segment SDKs, but it does mean a retry schedule that was previously 100ms, 150ms, 225ms… now starts at 500ms and climbs faster. Set
min_timeout_ms,max_timeout_msandmultiplieron aBackoffPolicyto keep the old pacing. - A
backoff_policysupplied by the caller that does not implementreset!now logs a warning. One policy instance serves every batch, so withoutreset!its attempt count accumulates and retries get slower the longer the process runs. - Fix
retriesgranting one fewer attempt than configured. A configured 10 performed 9, andretries: 1performed none at all.
- Fix silent failures (#269)
- Update to Ruby 3.2 (#262)
- Rename Segment namespace to SegmentIO (#259)
- Lower allocated and retained strings (#258)
- Modify timestamp to have 3 fractional digits (#250 && #251)
- Fix for empty user_id or anonymous_id (#245)
- Not enqueuing test action in real queue (#237)
- Fix test queue reset! documentation (#235)
- Enable overriding transport Pass options when initializing Transport (#230)
- Add test option for easier testing (#222)
- Improvement: Update timestamp for sub-millisecond reporting
- Update supported Ruby versions (2.4, 2.5, 2.6, 2.7), remove unsupported Ruby versions (2.0, 2.1, 2.2, 2.3)
- Promoted pre-release version to stable.
- Fix: Allow
anonymous_idin#aliasand#group.
- Promote pre-release version to stable.
- Fix: Don't assume all errors are 'ConnectionError's
- Fix: Revert 'reuse TCP connections' to fix EMFILE errors
- Fix: Fix oj/rails conflict
- Fix: Add missing 'Forwardable' requirement
- Improvement: Better logging
- Fix: Require
versionmodule first.
- Promote pre-release version to stable.
- Fix: Prevent 'batch size exceeded' errors by automatically batching items according to size
- Performance: Reuse TCP connections
- Improvement: Emit logs when in-memory queue is full
- Improvement: Emit logs when messages exceed maximum allowed size
- Improvement: Add exponential backoff to retries
- Improvement: Handle HTTP status code failure appropriately
- Fix: Override
respond_to_missinginstead ofrespond_to?to facilitate mock the library in tests.
- adding commander as dep (for CLI)
- add executables to spec
- Adding an (experimental) CLI
- Fix: Ensure error handler is called before Client#flush finishes.
- Feature: Support setting a custom message ID.
- readme: updated install docs
- fix: page/screen to allow no name
- git: ignore ruby version
- travis-ci: remove old rubys
- Fix batch being cleared and causing duplicates
- fix: don't clear batch if request failed
- Move timeout retry above output
- Fix rescuing timeouts
- fix: add 3 ms to timestamp
- fix: include optional options hash in calls
- fix: category param on #page and #screen
- fix: datetime conversions
- fix: isofying trait dates in #group
- fix: undefined method `is_requesting?' for nil:NilClass when calling flush (#51)
- fix: formatting ios dates
- fix: respond_to? implementation
- add: able to stub requests by setting STUB env var
- add: namespace under Segment::Analytics
- add: can create multiple instances with creator method (rather than having a singleton)
- add: logging with Logger instance or Rails.logger if available
- add: able to stub requests so they just log and don't hit the server
- fix: worker continues running across forked processes
- fix: removed usage of ActiveSupport methods since its not a dependency
- fix: sending data that matches segment's new api spec
(there is no v2.0.0)
- adding .initialized? by @lumberj
- removing faraday dependency
- adding .group(), .page(), and .screen() calls
- relaxing faraday dependency, fixes #31
- Add
requestIdfields to all requests for tracing.
- Allow the consumer thread to shut down so it won't remain live in hot deploy scenarios. This fixes the jruby memory leak by @nirvdrum
- adding
sleepbackoff between connection retries
- adding retries for connection hangups
- Removing global Analytics constant in favor of adding it to our config. NOTE: If you are upgrading from a previous version and want to continue using the
Analyticsnamespace, you'll have to addAnalytics = AnalyticsRubyto your config. Otherwise you WILL NOT be sending analytics data. See the setup docs for more info
- Adding support and tests for 1.8.7
- Pass
Timevalues as iso8601 timestamp strings
- Allow init/track/identify/alias to accept strings as keys. by @shipstar
- Adding faraday timeout by @yanchenyun
- Adding check for properties to be a Hash
- Adding alias call
- Adding flush method
- Adding ClassMethods for more extensibility by arronmabrey
- Fixing user_id.to_s semantics, reported by arronmabrey
- Reduced faraday requirements by arronmabrey
- Fixing thrown exception on non-initialized tracks thanks to sbellity
- Updating dependencies
- Adding actual support for MultiJson 1.0
- Updated docs to point at segment.io
- Renaming of all the files for proper bundling usage
- Updated readme and install instruction courtesy of @zeke
- Removed typhoeus and reverted to default adapter
- Removing session_id in favor of a single user_id
- Rakefile and renaming courtesy of @kiennt
- Updated tests with mocks