:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(error-tracking): attribute rule create/edit/delete analytics to the acting user (#75381)
posthog[bot]8cecf577c912
diff --git a/products/error_tracking/backend/presentation/views/assignment_rules.py b/products/error_tracking/backend/presentation/views/assignment_rules.pyindex b9f39fe15bbb..eb4c6a223caa 100644--- a/products/error_tracking/backend/presentation/views/assignment_rules.py+++ b/products/error_tracking/backend/presentation/views/assignment_rules.py@@ -159,6 +159,7 @@ class ErrorTrackingAssignmentRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generiraise NotFound()posthoganalytics.capture("error_tracking_assignment_rule_edited",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response({"ok": True}, status=status.HTTP_204_NO_CONTENT)@@ -182,6 +183,7 @@ class ErrorTrackingAssignmentRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generiraise NotFound()posthoganalytics.capture("error_tracking_assignment_rule_deleted",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(status=status.HTTP_204_NO_CONTENT)@@ -202,6 +204,7 @@ class ErrorTrackingAssignmentRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generiraise ValidationError(str(err)) from errposthoganalytics.capture("error_tracking_assignment_rule_created",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(self.get_serializer(rule).data, status=status.HTTP_201_CREATED)diff --git a/products/error_tracking/backend/presentation/views/bypass_rules.py b/products/error_tracking/backend/presentation/views/bypass_rules.pyindex a13dcbf22b14..6586a292b964 100644--- a/products/error_tracking/backend/presentation/views/bypass_rules.py+++ b/products/error_tracking/backend/presentation/views/bypass_rules.py@@ -112,6 +112,7 @@ class ErrorTrackingBypassRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVieraise NotFound()posthoganalytics.capture("error_tracking_bypass_rule_edited",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response({"ok": True}, status=status.HTTP_204_NO_CONTENT)@@ -135,6 +136,7 @@ class ErrorTrackingBypassRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVieraise NotFound()posthoganalytics.capture("error_tracking_bypass_rule_deleted",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(status=status.HTTP_204_NO_CONTENT)@@ -151,6 +153,7 @@ class ErrorTrackingBypassRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVieraise ValidationError(str(err)) from errposthoganalytics.capture("error_tracking_bypass_rule_created",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(self.get_serializer(rule).data, status=status.HTTP_201_CREATED)diff --git a/products/error_tracking/backend/presentation/views/grouping_rules.py b/products/error_tracking/backend/presentation/views/grouping_rules.pyindex b3e078f5600f..305838048bfe 100644--- a/products/error_tracking/backend/presentation/views/grouping_rules.py+++ b/products/error_tracking/backend/presentation/views/grouping_rules.py@@ -169,6 +169,7 @@ class ErrorTrackingGroupingRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVraise NotFound()posthoganalytics.capture("error_tracking_grouping_rule_edited",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response({"ok": True}, status=status.HTTP_204_NO_CONTENT)@@ -192,6 +193,7 @@ class ErrorTrackingGroupingRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVraise NotFound()posthoganalytics.capture("error_tracking_grouping_rule_deleted",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(status=status.HTTP_204_NO_CONTENT)@@ -212,6 +214,7 @@ class ErrorTrackingGroupingRuleViewSet(TeamAndOrgViewSetMixin, viewsets.GenericVraise ValidationError(str(err)) from errposthoganalytics.capture("error_tracking_grouping_rule_created",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(self.get_serializer(rule).data, status=status.HTTP_201_CREATED)diff --git a/products/error_tracking/backend/presentation/views/suppression_rules.py b/products/error_tracking/backend/presentation/views/suppression_rules.pyindex b6f129f0f0f3..7a6a3aad9380 100644--- a/products/error_tracking/backend/presentation/views/suppression_rules.py+++ b/products/error_tracking/backend/presentation/views/suppression_rules.py@@ -120,6 +120,7 @@ class ErrorTrackingSuppressionRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generraise NotFound()posthoganalytics.capture("error_tracking_suppression_rule_edited",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response({"ok": True}, status=status.HTTP_204_NO_CONTENT)@@ -143,6 +144,7 @@ class ErrorTrackingSuppressionRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generraise NotFound()posthoganalytics.capture("error_tracking_suppression_rule_deleted",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(status=status.HTTP_204_NO_CONTENT)@@ -165,6 +167,7 @@ class ErrorTrackingSuppressionRuleViewSet(TeamAndOrgViewSetMixin, viewsets.Generraise ValidationError(str(err)) from errposthoganalytics.capture("error_tracking_suppression_rule_created",+ distinct_id=request.user.pk,groups=groups(self.team.organization, self.team),)return Response(self.get_serializer(rule).data, status=status.HTTP_201_CREATED)