Integrate posthog and log events to track usage (#17)

This commit is contained in:
Kerem Yilmaz 2024-03-04 15:24:18 -08:00 committed by GitHub
parent 7322eac7b9
commit 879bc616d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 112 additions and 1 deletions

View file

@ -6,6 +6,7 @@ from datetime import datetime
import requests
import structlog
from scripts import tracking
from skyvern.exceptions import (
FailedToSendWebhook,
MissingValueForParameter,
@ -374,6 +375,7 @@ class WorkflowService:
api_key: str | None = None,
close_browser_on_completion: bool = True,
) -> None:
tracking.capture("skyvern-oss-agent-workflow-status", {"status": workflow_run.status})
browser_state = await app.BROWSER_MANAGER.cleanup_for_workflow_run(
workflow_run.workflow_run_id, close_browser_on_completion
)