(summary) report exception type in failure analytics

We know capture also the exception type that was raised
in failure analytics to provide more insights about what happened.
This commit is contained in:
Florent Chehab
2026-07-24 10:04:33 +02:00
parent dff5aa9575
commit 052d3c1b22
3 changed files with 12 additions and 1 deletions
+6
View File
@@ -8,9 +8,15 @@ and this project adheres to
## [Unreleased]
### Added
- ✨(summary) report exception type in failure analytics
## Fixed
- 🐛(transcription) fix silent bug in speaker assignment
- 🐛(summary) extend tasks auto retry logic
- 🐛(summary) properly detect when failure webhook should be sent
### Changed
+4 -1
View File
@@ -202,13 +202,16 @@ class MetadataManager:
},
)
def capture(self, task_id, event_name):
def capture(self, task_id, event_name, extra_properties=None):
"""Capture analytics event with task metadata and clean up."""
if self._is_disabled or not self.has_task_id(task_id):
return
metadata = self._get_metadata(task_id)
if extra_properties:
metadata = {**metadata, **extra_properties}
if "start_time" in metadata:
metadata["execution_time"] = round(time.time() - metadata["start_time"], 2)
del metadata["start_time"]
@@ -612,6 +612,7 @@ def handle_transcribe_v2_failed(
metadata_manager.capture(
task_id,
settings.posthog_transcript_failure,
{"exception_type": type(exception).__name__},
)
call_webhook_v2_task.apply_async(
args=[
@@ -720,6 +721,7 @@ def handle_summarize_v2_failed(
metadata_manager.capture(
task_id,
settings.posthog_summary_failure,
{"exception_type": type(exception).__name__},
)
call_webhook_v2_task.apply_async(
args=[