Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmd/atelet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ var (

otlpRelaySocket = pflag.String("otlp-relay-socket", ateompath.AteletOTLPSocketPath(), "Unix socket to serve the OTLP relay on, which forwards the node's ateom telemetry to OTEL_EXPORTER_OTLP_ENDPOINT so worker pods need no network path to the collector. Empty disables the relay.")

actorStatsPollInterval = pflag.Duration("actor-stats-poll-interval", time.Minute, fmt.Sprintf("Actor resource utilization sampling frequency. 0 disables the sampling entirely; minimum accepted value is %v.", minActorStatsPollInterval))

drainDelay = pflag.Duration("drain-delay", 0, "How long to keep accepting new RPCs after SIGTERM before starting the gRPC drain.")
drainTimeout = pflag.Duration("drain-timeout", 5*time.Minute, "Deadline for the graceful gRPC drain on shutdown. In-flight RPCs still running past it are forcefully cancelled.")
)
Expand Down Expand Up @@ -254,6 +256,20 @@ func main() {
serverboot.Fatal(ctx, "Failed to create Kubernetes clients", err)
}

if interval := clampActorStatsPollInterval(ctx, *actorStatsPollInterval); interval > 0 {
if statsInst, err := newStatsInstruments(otel.Meter("atelet")); err != nil {
// Telemetry must not take the node's lifecycle daemon down with
// it. Instrument creation only fails on programmer error
// (conflicting registration), which the poller's own tests catch
// in CI -- and the poller has an official disabled state, so a
// broken one degrades to that state, loudly, instead of
// crash-looping every actor operation on the node.
slog.ErrorContext(ctx, "Actor stats sampling disabled: failed to create instruments", slog.Any("err", err))
} else {
startStatsPoller(ctx, interval, statsInst, ateomDialer, k8sClient)
}
}

// TODO: Revisit scalability implications of using a shared informer. This lister
// is unlikely to be used with frequency.
ateFactory := externalversions.NewSharedInformerFactory(ateClient, 0)
Expand Down
Loading
Loading