feat: observe workflow inbox backlog

This commit is contained in:
2026-09-19 17:42:49 +08:00
parent da5874b17a
commit 0ac3f2f3f8
10 changed files with 46 additions and 8 deletions

View File

@@ -9,6 +9,7 @@ var components = []string{"workflow", "schedule", "execution_recovery"}
var taskStates = []string{"WAITING", "LEASED", "RUNNING", "NEEDS_REVIEW", "SUCCEEDED", "FAILED", "CANCELLED"}
var deliveryStates = []string{"PENDING", "LEASED", "ACKED", "EXPIRED"}
var workflowStates = []string{"RUNNING", "WAITING", "CANCELLING", "NEEDS_REVIEW", "SUCCEEDED", "FAILED", "CANCELLED"}
var inboxStates = []string{"PENDING", "LEASED", "PROCESSED", "QUARANTINED"}
var eventTypes = []string{"task.accepted", "task.started", "task.succeeded", "task.failed", "task.needs_review", "task.requeued", "workflow.started", "workflow.advanced", "workflow.recovered", "workflow.blocked", "workflow.stopped"}
// Every exported family is declared here, including each allowed label value.
@@ -43,6 +44,8 @@ func catalog() map[string]descriptor {
c["orbit_result_delivery_oldest_age_seconds"] = descriptor{gauge, "Age of the oldest sampled pending result delivery", nil}
c["orbit_weave_workflows_state"] = descriptor{gauge, "Bounded count of Weave instances by durable state", map[string][]string{"state": workflowStates}}
c["orbit_weave_workflow_oldest_age_seconds"] = descriptor{gauge, "Age of the oldest sampled unfinished Weave instance", nil}
c["orbit_weave_inbox_state"] = descriptor{gauge, "Bounded count of Weave internal inbox records by durable state", map[string][]string{"state": inboxStates}}
c["orbit_weave_inbox_oldest_age_seconds"] = descriptor{gauge, "Age of the oldest sampled pending Weave inbox record", nil}
c["orbit_business_events_recent"] = descriptor{gauge, "Bounded count of fixed event categories in the recent window", map[string][]string{"event": eventTypes}}
c["orbit_pulse_task_terminal_latency_seconds"] = descriptor{gauge, "Average sampled Pulse task create-to-terminal latency in seconds", nil}
c["orbit_pulse_task_terminal_latency_max_seconds"] = descriptor{gauge, "Maximum sampled Pulse task create-to-terminal latency in seconds", nil}