fix(rails): attribute events and requests to posthog-rails - #265
Merged
Conversation
Member
Author
|
needs PostHog/posthog#93911 |
Contributor
|
Reviews (1): Last reviewed commit: "fix(rails): attribute events to posthog-..." | Re-trigger Greptile |
posthog-ruby Compliance ReportDate: 2026-09-03 10:14:43 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
dustinbyrne
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Events and HTTP requests from the Rails integration currently identify themselves as
posthog-rubywith the core gem version. This prevents Rails integration usage from being attributed toposthog-rails.The core client now accepts internal library metadata and applies it to capture, identify, alias, and group identify events. It also uses the same metadata for event ingestion and feature flag request
User-Agentheaders. The Rails facade suppliesposthog-railsand the Rails gem version when it creates the client.💚 How did you test it?
bundle exec rspecbundle exec rubocopbundle exec rake public_api:checkgit diff --check📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Implemented with the Pi coding agent and checked with the autoreview skill. The Rails facade passes internal library metadata into the core client. Direct
posthog-rubyclients keep their existing event properties andUser-Agentheaders.