observability

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package observability owns the small durable receipts used by operators to distinguish a healthy empty sweep from a worker that never reached a terminal state. The helpers are deliberately best-effort: a telemetry write must not turn a provider outage into a second outage in the data plane.

Index

Constants

View Source
const (
	ConnectorSourceGoogleWorkspaceReports   = "google_workspace_reports"
	ConnectorSourceGoogleWorkspaceBigQuery  = "google_workspace_bigquery"
	ConnectorSourceGoogleWorkspaceDirectory = "google_workspace_directory"
	ConnectorSourceGoogleWorkspaceOAuth     = "google_workspace_oauth"
	RulePackBuiltIn                         = "builtin"
	RulePackCustom                          = "custom"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectorSyncRun

type ConnectorSyncRun struct {
	// contains filtered or unexported fields
}

ConnectorSyncRun is a handle for one connector source sweep. A nil handle means the receipt could not be inserted; Finish remains safe in that case.

func StartConnectorSyncRun

func StartConnectorSyncRun(ctx context.Context, db *sql.DB, organizationID, integrationID, provider, source string) *ConnectorSyncRun

StartConnectorSyncRun persists a RUNNING receipt before provider work starts.

func (*ConnectorSyncRun) Finish

func (r *ConnectorSyncRun) Finish(ctx context.Context, status string, recordsSeen, recordsQueued int, runErr error)

Finish records a terminal connector state. The organization and integration predicates make an accidental cross-tenant update impossible.

type RuleRun

type RuleRun struct {
	// contains filtered or unexported fields
}

RuleRun is a handle for one deterministic rule-pack evaluation.

func StartRuleRun

func StartRuleRun(ctx context.Context, db *sql.DB, organizationID, integrationID, provider, ingestionJobID, ruleKey, ruleVersion string, rulesEvaluated int) *RuleRun

StartRuleRun persists a RUNNING receipt before a rule pack is evaluated.

func (*RuleRun) Finish

func (r *RuleRun) Finish(ctx context.Context, status string, findingsCount int, runErr error)

Finish records a terminal rule-pack evaluation.

func (*RuleRun) SetRulesEvaluated

func (r *RuleRun) SetRulesEvaluated(rulesEvaluated int)

SetRulesEvaluated updates the count captured on the run handle. Finish writes the value with the terminal state, keeping the pre-load failure path able to create a receipt before custom rules are fetched.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL