MCPcopy Create free account
hub / github.com/PostHog/duckgres / captureProvisionFailed

Function captureProvisionFailed

controlplane/provisioner/controller.go:31–38  ·  view source on GitHub ↗

captureProvisionFailed emits warehouse_provision_failed with a stable reason category, but only when the terminal Failed transition actually landed (updateErr == nil). Emitting on a failed CAS would let a stuck warehouse re-fire the event every reconcile tick.

(w *configstore.ManagedWarehouse, reason string, updateErr error)

Source from the content-addressed store, hash-verified

29// captureProvisionFailed emits warehouse_provision_failed with a stable reason
30// category, but only when the terminal Failed transition actually landed
31// (updateErr == nil). Emitting on a failed CAS would let a stuck warehouse
32// re-fire the event every reconcile tick.
33func captureProvisionFailed(w *configstore.ManagedWarehouse, reason string, updateErr error) {
34 if updateErr != nil {
35 return
36 }
37 props := provisionEventProps(w)
38 props["reason"] = reason
39 analytics.Default().Capture("warehouse_provision_failed", w.OrgID, props)
40}
41

Callers 1

reconcileProvisioningMethod · 0.85

Calls 3

DefaultFunction · 0.92
provisionEventPropsFunction · 0.85
CaptureMethod · 0.65

Tested by

no test coverage detected