-
Notifications
You must be signed in to change notification settings - Fork 0
DBP-91: 在後端導入 PostHog #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "pan93412/dbp-91-\u5728\u5F8C\u7AEF\u5C0E\u5165-posthog"
Conversation
pan93412
commented
Oct 6, 2025
- feat: send events to PostHog
- test: update test for new EventService signature
- fix(server): inject PostHogClient
- feat(events): send point grant event to PostHog
- test(events): fix tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces PostHog analytics integration to the backend system, enabling event tracking and analytics data collection. The changes add PostHog as a dependency and update the event handling system to send events to PostHog alongside existing database operations.
Key changes:
- Added PostHog client configuration and initialization
- Updated EventService and PointsGranter to accept PostHog client
- Implemented event sending to PostHog for user actions and point grants
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
go.mod | Added posthog-go dependency |
internal/config/models.go | Added PostHog configuration structure with validation |
docs/config.md | Added PostHog configuration documentation |
cmd/backend/dependencies.go | Added PostHog client initialization and lifecycle management |
cmd/backend/server.go | Registered PostHog client in dependency injection |
internal/events/events.go | Updated EventService to send events to PostHog |
internal/events/points.go | Updated PointsGranter to send point grant events to PostHog |
Multiple test files | Updated test constructors to pass nil PostHog client |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ing for point grants
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 17 out of 18 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.