Add Scarf telemetry alongside PostHog

Both backends share session/version/first-run helpers in
strix/telemetry/_common.py and fire from the same four call sites in
strix/interface/main.py and strix/report/state.py. STRIX_TELEMETRY is
the single toggle for both.
This commit is contained in:
0xallam
2026-05-25 23:22:01 -07:00
parent 9d3e92d600
commit 61bf4fde11
9 changed files with 224 additions and 77 deletions
+3 -1
View File
@@ -16,7 +16,7 @@ from strix.report.writer import (
write_run_record,
write_vulnerabilities,
)
from strix.telemetry import posthog
from strix.telemetry import posthog, scarf
logger = logging.getLogger(__name__)
@@ -202,6 +202,7 @@ class ReportState:
self.vulnerability_reports.append(report)
logger.info(f"Added vulnerability report: {report_id} - {title}")
posthog.finding(severity)
scarf.finding(severity)
if self.vulnerability_found_callback:
self.vulnerability_found_callback(report)
@@ -254,6 +255,7 @@ class ReportState:
logger.info("Updated scan final fields")
self.save_run_data(mark_complete=True)
posthog.end(self, exit_reason="finished_by_tool")
scarf.end(self, exit_reason="finished_by_tool")
def set_scan_config(self, config: dict[str, Any]) -> None:
self.scan_config = config