Skip to content
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

feat: add a posthog capture event when a proxy record is created #26585

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

surbhi-posthog
Copy link
Contributor

@surbhi-posthog surbhi-posthog commented Dec 2, 2024

Problem

I'm adding managed reverse proxy created event on the backend. I'm assuming we use this in analytics downstream.

Changes

Verified that a proxy was created successfully

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Cloud: Yes

How did you test this code?

Tested locally on: http://localhost:8000/project/2/settings/organization-proxy
If there are other suggestions on how to verify if the logs are working correctly, please let me know. I might be missing stuff here.

posthog/api/proxy_record.py Show resolved Hide resolved
posthog/api/proxy_record.py Outdated Show resolved Hide resolved
request.user.distinct_id,
"proxy record created",
properties={
"organization_id": record.organization_id,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should need org id because that's included in the groups

@surbhi-posthog surbhi-posthog changed the title [RFC] feat: add a posthog capture event when a proxy record is created feat: add a posthog capture event when a proxy record is created Dec 3, 2024
@surbhi-posthog
Copy link
Contributor Author

I've added groups param to pass in the org data.

I'm still a bit confused on how to test this event. I'm used to making sure events hit final table as expected, which I wasn't able to perform. @zlwaterfield i know you mentioned that as long as we know the function was called, we don't have to worry about things downstream. The way I did this was ensure that there were no errors related to the reverse proxy capture event, but please let me know if there are other better ways to verify this.

@surbhi-posthog surbhi-posthog merged commit 7d03c37 into master Dec 3, 2024
94 of 95 checks passed
@surbhi-posthog surbhi-posthog deleted the capture_events_backend branch December 3, 2024 18:33
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.

2 participants