Skip to content

feat(rails): report Active Job retry failures - #336

Merged
marandaneto merged 6 commits into
mainfrom
feat/rails-job-retry-reporting-zPpC27
Nov 10, 2026
Merged

marandaneto merged 6 commits into
mainfrom
feat/rails-job-retry-reporting-zPpC27

Conversation

@marandaneto

@marandaneto marandaneto commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

💡 Motivation and Context

Public API addition: PostHog::Rails::Configuration#report_active_job_retries, default false. It requires auto_instrument_active_job.

Active Job can retry a failed execution without letting the error escape to the terminal exception handler. Applications can now opt in to reporting those failures when Active Job schedules a retry. Rails 6+ uses its retry notification. Rails 5.2 retains the error during rescue_with_handler and observes retry_job without replacing the handler or scheduling logic.

Retry reports use the job's effective saved or extracted identity and session, filtered arguments, and existing core exception-object deduplication. Request and worker properties stay isolated. Missing or disabled clients do nothing. Reporting failures do not interrupt retries. Discarded failures and failures consumed by rescue or terminal retry handlers do not gain reports.

Retry reports honor default and configured excluded_exceptions across the serialized cause chain, including cycle detection and the 50-entry limit. Excluded failures still schedule retries. Existing terminal capture behavior and metadata are unchanged.

New retry events use source rails.active_job, level error, and mechanism task with handled: true. The relevant boundary is framework job execution, including the retry handler: Active Job consumes the failure and reschedules instead of allowing it to escape. Terminal failures that escape job execution remain unhandled. The cross-SDK boundary clarification is recorded in sdk-specs#205, which is awaiting review. Source and level use the existing additional-properties path rather than a typed internal metadata channel. Retry filtering follows the capture-exception ignored-type chain rule while retaining the existing Rails default exclusion list rather than introducing a new empty-by-default list.

A Rails-only minor changeset, initializer examples, README guidance, and intentional public API snapshot additions are included. The existing changeset was updated rather than duplicated. The branch includes a signed merge of origin/main at ceb36ce01e7eb0d090102e02dcd3afff89279e0c, committed as 9f85498ebe7bccb67cda7df7a7c1fdac7bcec684, without rewriting history. The earlier signed merge a0998b8aa777483e3d7d03028b52d5bac6edba6c remains in history. Its only conflict was in public_api_snapshot.txt. The latest merge also includes the controller exception helper that landed afterward and had no conflicts. Regenerating it retained both the notification logs API from main and this PR’s retry option.

💚 How did you test it?

Local validation of merged head 9f85498ebe7bccb67cda7df7a7c1fdac7bcec684 used Ruby 4.0.7, Bundler 4.0.13 and Rails 7.2.3.1.

  • bundle exec rspec: 2389 examples, 0 failures, 43 optional-integration pending.
  • BUNDLE_GEMFILE=gemfiles/otel.gemfile BUNDLE_PATH=/Users/marandaneto/Github/posthog-ruby/vendor/bundle bundle exec rspec: 2389 examples, 0 failures, 2 existing MCP pending.
  • bundle exec rubocop: 163 files, no offenses.
  • bundle exec rake public_api:generate resolved the snapshot conflict. bundle exec rake public_api:check, git diff --check, and the unmerged-file check passed.
  • Both locked bundles were installed from the merged manifests without further lockfile changes.
  • The real matched Active Job/ActiveSupport 5.2.8.1 standalone lifecycle harness passed. It uses minimal Rails version/application/config host accessors and records JSON-round-tripped queue payloads. It does not boot a full Rails 5.2 application or patch framework retry methods.
  • Exact-head isolated autoreview ran in branch mode against origin/main and reported no actionable findings. Diff-scoped cleanup and the Authoring-mode test audit found no blockers.

Review concerns were reproduced before their production fixes. Direct and nested configured/default exclusions and the entry-50 boundary failed with unexpected reports, then passed after filtering. The Rails 5.2 lifecycle failed with expected 1 retry events, got 0, then passed after compatibility support. For the handled-state follow-up, the retry suite failed four examples because retry events still had handled: false, and the real Rails 5.2 lifecycle failed with retry not marked handled. Both passed after the metadata fix. Retained assertions verify that escaping terminal failures remain unhandled.

Tests retain scheduling, original exceptions and returns, single handler invocation, identity/context isolation, exclusion boundaries and cycles, stale-error cleanup, client gates, privacy hooks, deduplication, eventual success, reporting failures, and both Rails initialization load orders. The complete historical Ruby/Rails matrix was not run locally. A Rails 8.1.4 full-suite run passed before the handled-state follow-up, but was not repeated locally for this merge. All 30 GitHub checks passed for exact merged head 9f85498ebe7bccb67cda7df7a7c1fdac7bcec684, including Unit Tests, latest Rails, optional integrations, API, lint, builds, compliance, security and benchmarks. Human review is still required.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

The changeset is hand-authored. I did not run pnpm changeset or add a duplicate.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

marandaneto is the human DRI and PR assignee. Pi's worker used shell/file tools, Git, GitHub CLI, and the autoreview helper with the claude-code/claude-opus-5-5 provider. There is no public session URL.

The approved follow-up scope adds retry-only exclusion filtering, supported Active Job 5.2 compatibility, and handled metadata for framework-consumed retries. The handled-state choice and separate spec clarification were explicitly approved by marandaneto. It leaves terminal exclusions, tracing features, and other PRs untouched. The branch was updated using a new signed merge, without rewriting history. This PR will not be self-approved or merged.

@marandaneto marandaneto self-assigned this Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

posthog-ruby-sync Compliance Report

Date: 2026-11-10T08:49:27.823623+00:00
Duration: 56137ms

⚠️ Some Tests Failed

39/47 tests passed, 8 failed


Capture Tests

⚠️ 23/30 tests passed, 7 failed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 8ms
Format Validation.Event Has Uuid ✅ 5ms
Format Validation.Event Has Lib Properties ✅ 5ms
Format Validation.Distinct Id Is String ✅ 7ms
Format Validation.Token Is Present ✅ 6ms
Format Validation.Custom Properties Preserved ✅ 6ms
Format Validation.Event Has Timestamp ✅ 7ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 5ms
Retry Behavior.Retries On 503 ✅ 5288ms
Retry Behavior.Does Not Retry On 400 ❌ 6ms
Retry Behavior.Does Not Retry On 401 ❌ 4ms
Retry Behavior.Respects Retry After Header ✅ 8012ms
Retry Behavior.Implements Backoff ❌ 337ms
Retry Behavior.Retries On 500 ✅ 5152ms
Retry Behavior.Retries On 502 ✅ 5116ms
Retry Behavior.Retries On 504 ✅ 5114ms
Retry Behavior.Max Retries Respected ❌ 676ms
Deduplication.Generates Unique Uuids ✅ 15ms
Deduplication.Preserves Uuid On Retry ✅ 5142ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10346ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5119ms
Deduplication.No Duplicate Events In Batch ✅ 15ms
Deduplication.Different Events Have Different Uuids ✅ 8ms
Compression.Sends Gzip When Enabled ✅ 5ms
Batch Format.Uses Proper Batch Structure ✅ 4ms
Batch Format.Flush With No Events Sends Nothing ✅ 3ms
Batch Format.Multiple Events Batched Together ❌ 13ms
Error Handling.Does Not Retry On 403 ❌ 4ms
Error Handling.Does Not Retry On 413 ❌ 4ms
Error Handling.Retries On 408 ✅ 5154ms

Failures

retry_behavior.does_not_retry_on_400

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

retry_behavior.does_not_retry_on_401

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

retry_behavior.implements_backoff

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

retry_behavior.max_retries_respected

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

batch_format.multiple_events_batched_together

Expected 1 requests, got 5

error_handling.does_not_retry_on_403

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

error_handling.does_not_retry_on_413

500, message='Internal Server Error', url='http://sdk-adapter:8080/capture'

Feature_Flags Tests

⚠️ 16/17 tests passed, 1 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 8ms
Request Payload.Flags Request Uses V2 Query Param ✅ 7ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 7ms
Request Payload.Flags Request Omits Authorization Header ✅ 6ms
Request Payload.Token In Flags Body Matches Init ✅ 6ms
Request Payload.Groups Round Trip ✅ 6ms
Request Payload.Groups Default To Empty Object ✅ 5ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 6ms
Request Payload.Disable Geoip Omitted Defaults To False ❌ 5ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 5ms
Request Lifecycle.No Flags Request On Init Alone ✅ 2ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 5ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 8ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 5ms
Retry Behavior.Retries Flags On 502 ✅ 108ms
Retry Behavior.Retries Flags On 504 ✅ 137ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 8ms

Failures

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['distinct_id', 'groups', 'person_properties', 'group_properties', 'flag_keys_to_evaluate', 'token']

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

posthog-ruby-async Compliance Report

Date: 2026-11-10T08:49:53.319658+00:00
Duration: 98339ms

⚠️ Some Tests Failed

46/47 tests passed, 1 failed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 106ms
Format Validation.Event Has Uuid ✅ 103ms
Format Validation.Event Has Lib Properties ✅ 105ms
Format Validation.Distinct Id Is String ✅ 104ms
Format Validation.Token Is Present ✅ 104ms
Format Validation.Custom Properties Preserved ✅ 104ms
Format Validation.Event Has Timestamp ✅ 104ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 4ms
Retry Behavior.Retries On 503 ✅ 5407ms
Retry Behavior.Does Not Retry On 400 ✅ 2105ms
Retry Behavior.Does Not Retry On 401 ✅ 2106ms
Retry Behavior.Respects Retry After Header ✅ 8106ms
Retry Behavior.Implements Backoff ✅ 15719ms
Retry Behavior.Retries On 500 ✅ 5210ms
Retry Behavior.Retries On 502 ✅ 5209ms
Retry Behavior.Retries On 504 ✅ 5209ms
Retry Behavior.Max Retries Respected ✅ 15609ms
Deduplication.Generates Unique Uuids ✅ 107ms
Deduplication.Preserves Uuid On Retry ✅ 5208ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10407ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5210ms
Deduplication.No Duplicate Events In Batch ✅ 107ms
Deduplication.Different Events Have Different Uuids ✅ 104ms
Compression.Sends Gzip When Enabled ✅ 103ms
Batch Format.Uses Proper Batch Structure ✅ 104ms
Batch Format.Flush With No Events Sends Nothing ✅ 3ms
Batch Format.Multiple Events Batched Together ✅ 107ms
Error Handling.Does Not Retry On 403 ✅ 2106ms
Error Handling.Does Not Retry On 413 ✅ 2105ms
Error Handling.Retries On 408 ✅ 5208ms

Feature_Flags Tests

⚠️ 16/17 tests passed, 1 failed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 104ms
Request Payload.Flags Request Uses V2 Query Param ✅ 103ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 104ms
Request Payload.Flags Request Omits Authorization Header ✅ 103ms
Request Payload.Token In Flags Body Matches Init ✅ 104ms
Request Payload.Groups Round Trip ✅ 103ms
Request Payload.Groups Default To Empty Object ✅ 104ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 104ms
Request Payload.Disable Geoip Omitted Defaults To False ❌ 103ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 104ms
Request Lifecycle.No Flags Request On Init Alone ✅ 2ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 103ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 107ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 104ms
Retry Behavior.Retries Flags On 502 ✅ 204ms
Retry Behavior.Retries Flags On 504 ✅ 236ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 105ms

Failures

request_payload.disable_geoip_omitted_defaults_to_false

Field 'geoip_disable' not found in /flags request body at path 'geoip_disable'. Available keys: ['distinct_id', 'groups', 'person_properties', 'group_properties', 'flag_keys_to_evaluate', 'token']

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

SDK performance: posthog-ruby

Benchmarks completed. No changes flagged for review.

Flags require at least a 5% change in the median and all six pairs agreeing on direction. This is a noise filter, not proof of a performance change or a CI gate.

View all results
Test Measurement Before PR With PR Change Assessment
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Queue an event (32-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (32-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (4,096-byte payload)
Shard: capture
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Queue an event (4,096-byte payload)
Shard: capture
Allocations per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​; head:​ Background serialization has no public enqueue completion boundary; use completed-delivery workloads for process-wide allocation counts.​
Evaluate all 10 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate all 100 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate all 1,000 flags
Shard: flags-scaling
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate one boolean flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a cohort-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (early match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (late match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a flag (no match)
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a property-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a regex-filtered flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a rollout flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Evaluate a multivariate flag
Shard: flags-single
Allocated memory per operation — — — unavailable; base:​ unsupported; head:​ unsupported; base:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​; head:​ Ruby has no cumulative allocated-byte counter here; retained ObjectSpace bytes are not allocation volume.​
Capture and deliver events (32-byte payload, burst)
Shard: capture
Allocations per operation 56.27 count/op 56.27 count/op No observed change Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Time per operation 114.33 µs/op 113.94 µs/op 0.3% less time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Idle process memory (RSS) 28.3 MiB 28.28 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 31.06 MiB 31.04 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Managed heap after settling 5.28 MiB 5.28 MiB No observed change Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 30.3 MiB 30.28 MiB <0.1% less memory Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Process CPU time per operation 31 µs/op 30.73 µs/op 0.9% less time Not flagged
Capture and deliver events (32-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 30.87 MiB 30.78 MiB 0.3% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Allocations per operation 58.65 count/op 58.65 count/op No observed change Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Time per operation 113.74 µs/op 113.9 µs/op 0.1% more time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Idle process memory (RSS) 33.11 MiB 33.14 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Observed peak process memory (RSS) 42.06 MiB 42.34 MiB 0.7% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Managed heap after settling 9.15 MiB 9.15 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process memory after settling (RSS) 40.12 MiB 40.62 MiB 1.3% more memory Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Process CPU time per operation 43.43 µs/op 44.08 µs/op 1.5% more time Not flagged
Capture and deliver events (4,096-byte payload, burst)
Shard: capture
Lifetime peak process memory (RSS) 41.75 MiB 42.09 MiB 0.8% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Allocations per operation 58.68 count/op 58.68 count/op No observed change Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Time per operation 1.02 ms/op 1.02 ms/op <0.1% less time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Idle process memory (RSS) 28.23 MiB 28.23 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 30.33 MiB 30.33 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Managed heap after settling 5.28 MiB 5.28 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 30.33 MiB 30.33 MiB <0.1% more memory Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Process CPU time per operation 44.15 µs/op 43.93 µs/op 0.5% less time Not flagged
Capture and deliver events (32-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 30.33 MiB 30.33 MiB <0.1% more memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Allocations per operation 58.68 count/op 58.68 count/op No observed change Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Time per operation 1.02 ms/op 1.02 ms/op <0.1% more time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Idle process memory (RSS) 33.13 MiB 33.12 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Observed peak process memory (RSS) 40.48 MiB 40.47 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Managed heap after settling 9.15 MiB 9.15 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process memory after settling (RSS) 40.12 MiB 40.08 MiB <0.1% less memory Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Process CPU time per operation 52.69 µs/op 53.23 µs/op 1% more time Not flagged
Capture and deliver events (4,096-byte payload, steady)
Shard: capture
Lifetime peak process memory (RSS) 40.63 MiB 40.62 MiB <0.1% less memory Not flagged
Queue an event (32-byte payload)
Shard: capture
Caller-thread CPU time per operation 13.45 µs/op 13.83 µs/op 2.8% more time Not flagged
Queue an event (32-byte payload)
Shard: capture
Time per operation 13.45 µs/op 13.82 µs/op 2.8% more time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Caller-thread CPU time per operation 13.34 µs/op 13.34 µs/op <0.1% less time Not flagged
Queue an event (4,096-byte payload)
Shard: capture
Time per operation 13.34 µs/op 13.33 µs/op <0.1% less time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Allocations per operation 343.02 count/op 343.02 count/op No observed change Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Time per operation 79.88 µs/op 77.96 µs/op 2.4% less time Not flagged
Evaluate all 10 flags
Shard: flags-scaling
Process CPU time per operation 79.89 µs/op 77.96 µs/op 2.4% less time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Allocations per operation 3,324 count/op 3,324 count/op No observed change Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Time per operation 758.54 µs/op 761.02 µs/op 0.3% more time Not flagged
Evaluate all 100 flags
Shard: flags-scaling
Process CPU time per operation 758.5 µs/op 761.01 µs/op 0.3% more time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Allocations per operation 33,113.59 count/op 33,113.59 count/op No observed change Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Time per operation 7.66 ms/op 7.87 ms/op 2.7% more time Not flagged
Evaluate all 1,000 flags
Shard: flags-scaling
Process CPU time per operation 7.66 ms/op 7.87 ms/op 2.7% more time Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Idle process memory (RSS) 38.78 MiB 38.75 MiB <0.1% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Observed peak process memory (RSS) 40.48 MiB 41.05 MiB 1.4% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Managed heap after settling 7.97 MiB 7.97 MiB <0.1% more memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Process memory after settling (RSS) 39.42 MiB 39.27 MiB 0.4% less memory Not flagged
Evaluate 1,000 flags under concurrent load
Shard: flags-memory
Lifetime peak process memory (RSS) 40.09 MiB 40.64 MiB 1.4% more memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Idle process memory (RSS) 38.12 MiB 37.6 MiB 1.4% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Observed peak process memory (RSS) 41.38 MiB 41.33 MiB 0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Managed heap after settling 9.48 MiB 9.48 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Process memory after settling (RSS) 41.36 MiB 41.33 MiB <0.1% less memory Not flagged
Refresh 1,000 flag definitions
Shard: flags-memory
Lifetime peak process memory (RSS) 41.36 MiB 41.33 MiB <0.1% less memory Not flagged
Evaluate one boolean flag
Shard: flags-single
Allocations per operation 38 count/op 38 count/op No observed change Not flagged
Evaluate one boolean flag
Shard: flags-single
Time per operation 8.85 µs/op 8.87 µs/op 0.2% more time Not flagged
Evaluate one boolean flag
Shard: flags-single
Process CPU time per operation 8.85 µs/op 8.87 µs/op 0.2% more time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Allocations per operation 38 count/op 38 count/op No observed change Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Time per operation 12.04 µs/op 11.97 µs/op 0.6% less time Not flagged
Evaluate a cohort-filtered flag
Shard: flags-single
Process CPU time per operation 12.04 µs/op 11.97 µs/op 0.6% less time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Allocations per operation 55 count/op 55 count/op No observed change Not flagged
Evaluate a flag (early match)
Shard: flags-single
Time per operation 15.31 µs/op 15.21 µs/op 0.7% less time Not flagged
Evaluate a flag (early match)
Shard: flags-single
Process CPU time per operation 15.31 µs/op 15.21 µs/op 0.7% less time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Allocations per operation 76 count/op 76 count/op No observed change Not flagged
Evaluate a flag (late match)
Shard: flags-single
Time per operation 21.42 µs/op 21.49 µs/op 0.3% more time Not flagged
Evaluate a flag (late match)
Shard: flags-single
Process CPU time per operation 21.42 µs/op 21.49 µs/op 0.4% more time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Allocations per operation 67 count/op 67 count/op No observed change Not flagged
Evaluate a flag (no match)
Shard: flags-single
Time per operation 19.19 µs/op 19.32 µs/op 0.7% more time Not flagged
Evaluate a flag (no match)
Shard: flags-single
Process CPU time per operation 19.19 µs/op 19.32 µs/op 0.7% more time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Allocations per operation 34 count/op 34 count/op No observed change Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Time per operation 9.03 µs/op 9.01 µs/op 0.2% less time Not flagged
Evaluate a property-filtered flag
Shard: flags-single
Process CPU time per operation 9.03 µs/op 9.01 µs/op 0.2% less time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Allocations per operation 99 count/op 99 count/op <0.1% more Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Time per operation 26.03 µs/op 26.21 µs/op 0.7% more time Not flagged
Evaluate a regex-filtered flag
Shard: flags-single
Process CPU time per operation 26.03 µs/op 26.2 µs/op 0.7% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Allocations per operation 31 count/op 31 count/op No observed change Not flagged
Evaluate a rollout flag
Shard: flags-single
Time per operation 7.89 µs/op 7.98 µs/op 1.1% more time Not flagged
Evaluate a rollout flag
Shard: flags-single
Process CPU time per operation 7.89 µs/op 7.98 µs/op 1.1% more time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Allocations per operation 37 count/op 37 count/op No observed change Not flagged
Evaluate a multivariate flag
Shard: flags-single
Time per operation 9.84 µs/op 9.85 µs/op 0.1% more time Not flagged
Evaluate a multivariate flag
Shard: flags-single
Process CPU time per operation 9.84 µs/op 9.85 µs/op 0.1% more time Not flagged

Values are medians of paired measurements. Not flagged does not mean unchanged. Unavailable means a measurement could not be provided, not zero. Estimated allocation measurements retain their instrumentation uncertainty. RSS measures the whole process, not just SDK allocations; observed peaks are sampled checkpoints. Paired ranges in the diagnostics describe variability, not confidence intervals.

Each shard uses its own runner; compare Before PR against With PR within a row, not across shards.

Compared ceb36ce01e7eb0d090102e02dcd3afff89279e0c → 9f85498ebe7bccb67cda7df7a7c1fdac7bcec684.

Full report and diagnostics

102 metric rows; 102 rows shown in all results. Omitted or shortened data remain in comparison.json, including per-runner environments, resource limits, measurement methods, samples and checkpoints.

@marandaneto
marandaneto marked this pull request as ready for review November 6, 2026 14:50
@marandaneto
marandaneto requested a review from a team as a code owner November 6, 2026 14:50

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PostHog Review · Standard · reviewed b9ed274: 2 Should fix.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two issues remain in the new retry-reporting path: configured exception exclusions are ignored, and Rails 5.2 never emits the subscribed notification. Consider honoring exclusions and either supporting that runtime or documenting an explicit capability restriction.

AI-assisted review.

@dustinbyrne
dustinbyrne requested a review from a team November 6, 2026 17:50
@marandaneto

marandaneto commented Nov 7, 2026 •

Copy link
Copy Markdown
Member Author

Both repeated review concerns are addressed in 2f0becd, pushed with signed main merge e3f1a49. Retry-only exclusion regressions went from 5 failures to green, and the real matched Active Job 5.2.8.1 lifecycle went from missing the opted-in retry report to passing default-off, scheduling, terminal, identity/context and handler controls. All four inline threads now have specific evidence and are resolved. Base and optional Rails 7.2.3.1 suites pass with 2198 examples; Rails 8.1.4 passes all 2198. Lint, API check and exact-HEAD isolated autoreview pass. The PR description records the standalone 5.2 harness limits and unchanged terminal behavior. All nine jobs in the pushed Unit Tests workflow passed: https://github.com/PostHog/posthog-ruby/actions/runs/42346959091.

@ioannisj ioannisj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 An AI agent wrote this on behalf of @ioannisj.

One question on the handled value for retried failures, otherwise nothing from me. Went through the Rails 6+ notification path, the 5.2 interception, the exclusion chain walk, identity and argument handling, the new specs, CI and the changeset.

@veria-ai

veria-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Reviews

@marandaneto

Copy link
Copy Markdown
Member Author

Merged the latest origin/main (ceb36ce01e7eb0d090102e02dcd3afff89279e0c) into this branch without rewriting history. Signed merge commits: a0998b8aa777483e3d7d03028b52d5bac6edba6c, then 9f85498ebe7bccb67cda7df7a7c1fdac7bcec684 after the controller helper landed. The only conflict was the API snapshot in the first merge; regeneration retained both logs notifications and retry reporting. The second merge was clean.

Final local base and optional OpenTelemetry suites each pass 2,389 examples with no failures. Rails 5.2 lifecycle, lint, public API and exact-head isolated branch autoreview pass. All 30 checks passed for 9f85498, including unit tests, latest Rails, integrations, builds, compliance, security and benchmarks. No CI fixes were needed. The PR is mergeable, and the worktree is clean. The PR itself has not been merged.

@marandaneto
marandaneto merged commit 60ad7a7 into main Nov 10, 2026
31 of 32 checks passed
@marandaneto
marandaneto deleted the feat/rails-job-retry-reporting-zPpC27 branch November 10, 2026 09:07
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