mirror of
https://github.com/suitenumerique/meet.git
synced 2026-07-27 20:29:09 +00:00
✨(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:
@@ -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=[
|
||||
|
||||
Reference in New Issue
Block a user