diff --git a/src/sentry/api/endpoints/project_metrics_extraction_rules.py b/src/sentry/api/endpoints/project_metrics_extraction_rules.py index 0726674e41d13e..9cb2ef4464261f 100644 --- a/src/sentry/api/endpoints/project_metrics_extraction_rules.py +++ b/src/sentry/api/endpoints/project_metrics_extraction_rules.py @@ -62,7 +62,9 @@ def has_feature(self, organization, request): "organizations:custom-metrics-extraction-rule", organization, actor=request.user ) - def _create_audit_entry(self, event: str, project: Project, span_attribute: str): + def _create_audit_entry( + self, event: str, project: Project, span_attribute: str, config_update: str + ): self.create_audit_entry( request=self.request, organization=project.organization, @@ -71,6 +73,7 @@ def _create_audit_entry(self, event: str, project: Project, span_attribute: str) data={ "span_attribute": span_attribute, "project_slug": project.slug, + "config_update": config_update, }, ) @@ -91,7 +94,10 @@ def delete(self, request: Request, project: Project) -> Response: ) for config in config_update: self._create_audit_entry( - "SPAN_BASED_METRIC_DELETE", project, config["spanAttribute"] + "SPAN_BASED_METRIC_DELETE", + project, + config["spanAttribute"], + str(config_update), ) return Response(status=204) @@ -142,7 +148,10 @@ def post(self, request: Request, project: Project) -> Response: ) for config in configs: self._create_audit_entry( - "SPAN_BASED_METRIC_CREATE", project, config.span_attribute + "SPAN_BASED_METRIC_CREATE", + project, + config.span_attribute, + str(config_update), ) persisted_config = serialize( @@ -167,7 +176,9 @@ def put(self, request: Request, project: Project) -> Response: project_id=project.id, trigger="span_attribute_extraction_configs" ) for config in configs: - self._create_audit_entry("SPAN_BASED_METRIC_UPDATE", project, config.span_attribute) + self._create_audit_entry( + "SPAN_BASED_METRIC_UPDATE", project, config.span_attribute, str(config_update) + ) persisted_config = serialize( configs,