Operators
For more context, read the satellite architecture documentation first.
The Operator executes pre-approved remediation actions. Before acting, it re-evaluates the trigger condition against current state. It runs in a sandboxed environment with resource limits, logs every action, and rolls back on validation failure.
Core Types
ActionLog
A single event in an operator execution. Operators write one entry before attempting a step and one after, so partial progress is visible even if the operator crashes mid-execution.
type ActionLog struct {
ID RecordID
ExecutionID RecordID
StepID string // optional; groups Attempting + outcome entries for one step
Description string
State ActionLogState // Attempting | Success | Failed | Info
Timestamp time.Time
}Description carries the human-readable detail, including error text on failure. State makes the log machine-readable without parsing description strings.
Write an ActionLog for every state-modifying action — calls that create, update, or delete resources in an external system. Write one entry with Attempting before the call and one with Success or Failed after. Reads, queries, and internal checks do not need entries.
Set StepID to the same value on both entries so that consumers can correlate the attempt with its outcome. StepID is optional — Info entries do not need one.
Attempting is a distinct state from Info. An Attempting entry always has an expected corresponding Success or Failed entry with the same StepID. An Attempting entry with no partner indicates the operator crashed mid-step. Info entries are self-contained — no following entry is expected.
Use Info to record a decision or observation that is not obvious from context — for example, "version 14.1.x detected; issue does not apply, stopping."
ExecutionID is generated by the runner before Execute is called and injected automatically via the OperatorStore wrapper. It links all ActionLog entries for one execution to the terminal RecordedAction. The operator does not set it.
Example — three entries for an F5OS tenant restart operation:
[
{
"id": "019271c1-...",
"execution_id": "019271c0-...",
"step_id": "",
"description": "Affected F5OS version detected: F5OS-A 1.5.0",
"state": "info",
"timestamp": "2026-09-15T14:23:01Z"
},
{
"id": "019271c2-...",
"execution_id": "019271c0-...",
"step_id": "restart-tenant-1",
"description": "Restarting tenant-1 on F5OS to restore inaccessible VLANs.",
"state": "attempting",
"timestamp": "2026-09-15T14:23:02Z"
},
{
"id": "019271c3-...",
"execution_id": "019271c0-...",
"step_id": "restart-tenant-1",
"description": "tenant-1 restarted successfully.",
"state": "success",
"timestamp": "2026-09-15T14:23:04Z"
}
]RecordedAction
A lifecycle record for one operator execution. The runner writes two records per execution: one when execution starts (Started) and one when it completes (Success or Failed). Both records share the same ExecutionID, which links them to each other and to all ActionLog entries for that execution.
type RecordedAction struct {
ID RecordID
ExecutionID RecordID
OperatorName string
InsightID RecordID
State RecordedActionState // Started | Success | Failed
Timestamp time.Time
}Timestamp records when the runner wrote this record. For Started, it is the time the runner began the execution. For Success or Failed, it is the time Execute returned.
All ActionLog entries for the same execution share the same ExecutionID as both records.
Example — two records for the F5OS tenant restart:
[
{
"id": "019271c4-...",
"execution_id": "019271c0-...",
"operator_name": "f5os-restart-tenant",
"insight_id": "019271b2-...",
"state": "started",
"timestamp": "2026-09-15T14:23:00Z"
},
{
"id": "019271c5-...",
"execution_id": "019271c0-...",
"operator_name": "f5os-restart-tenant",
"insight_id": "019271b2-...",
"state": "success",
"timestamp": "2026-09-15T14:23:04Z"
}
]Filter type: InsightFilter
An Operator doesn't need to be notified about all Insights. That's why each Operator can specify a filter.
type InsightFilter struct {
Patterns []string // empty = all
Severities []Severity // empty = all
}Operator interface
An Operator executes a remediation action. It writes ActionLog entries when attempting actions or as steps complete. It returns nil on success, or an error if the execution is unsuccessful.
type OperatorStore interface {
AddActionLog(ctx context.Context, log NewActionLog) (RecordID, error)
QueryTelemetryByTime(ctx context.Context, q TelemetryTimeRangeQuery) (QueryResult[TelemetryRecord], error)
QueryTelemetryFromCursor(ctx context.Context, q TelemetryCursorQuery) (QueryResult[TelemetryRecord], error)
}
type Operator interface {
Name() string
Filter() InsightFilter
Execute(ctx context.Context, logger *slog.Logger, insight Insight, s OperatorStore) error
}The runner generates an ExecutionID before calling Execute. It binds the ExecutionID to the scoped OperatorStore passed to Execute, so every AddActionLog call automatically carries the correct execution context. The operator never sees the ExecutionID. The runner uses the same ID for both RecordedAction records.
type F5ReenablePoolMemberOperator struct{}
func (o *F5ReenablePoolMemberOperator) Name() string { return "f5-reenable-pool-member" }
func (o *F5ReenablePoolMemberOperator) Filter() InsightFilter {
return InsightFilter{
Patterns: []string{"f5-pool-member-down"},
}
}
func (o *F5ReenablePoolMemberOperator) Execute(
ctx context.Context,
logger *slog.Logger,
insight Insight,
s OperatorStore,
) error {
// re-query the observation window to find the affected pool member
result, err := s.QueryTelemetryByTime(ctx, TelemetryTimeRangeQuery{
Start: insight.WindowStart,
End: insight.WindowEnd,
Attributes: map[string]string{"service.name": "f5-ltm", "pool.member.state": "down"},
})
if err != nil || len(result.Records) == 0 {
return err
}
member := result.Records[0].Attributes["pool.member.address"]
s.AddActionLog(ctx, NewActionLog{
StepID: "reenable-member",
Description: "Re-enabling pool member " + member + " in web_pool.",
State: ActionLogStateAttempting,
})
err = HTTP.Patch(ctx, "f5-mgmt",
"/mgmt/tm/ltm/pool/~Common~web_pool/members/"+member,
map[string]string{"session": "user-enabled"},
)
if err != nil {
s.AddActionLog(ctx, NewActionLog{
StepID: "reenable-member",
Description: "Failed to re-enable pool member " + member + ": " + err.Error(),
State: ActionLogStateFailed,
})
return err
}
s.AddActionLog(ctx, NewActionLog{
StepID: "reenable-member",
Description: "Pool member " + member + " re-enabled successfully.",
State: ActionLogStateSuccess,
})
return nil
}
func init() { registry.RegisterOperator(&F5ReenablePoolMemberOperator{}) }