observability

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package observability builds transport-independent, task-oriented views of Numaflow runtime resources for API v2. It reads Kubernetes CRs only; it does not call the daemon, list Pods, or implement v1-style live resource health.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	Type               string
	Status             string
	Reason             string
	Message            string
	ObservedGeneration int64
	LastTransitionTime time.Time
}

Condition is a bounded Kubernetes condition copied from Vertex or MonoVertex CR status.

type Health

type Health struct {
	State   HealthState
	Reason  string
	Message string
}

Health is a compact view of Kubernetes Vertex or MonoVertex CR status for summary endpoints. It is not v1 pipeline /health, which inspects live Pods and daemon data-flow.

type HealthState

type HealthState string
const (
	HealthStateHealthy  HealthState = "healthy"
	HealthStateWarning  HealthState = "warning"
	HealthStateCritical HealthState = "critical"
	HealthStateInactive HealthState = "inactive"
	HealthStateUnknown  HealthState = "unknown"
)

type ReplicaStatus

type ReplicaStatus struct {
	Current      int64
	Desired      int64
	Ready        int64
	Updated      int64
	UpdatedReady int64
}

ReplicaStatus reports replica counts from the Vertex or MonoVertex CR status.

type Result

type Result[T any] struct {
	Value           T
	ResourceVersion string
}

Result pairs a DTO with the backing CR resourceVersion for HTTP ETag handling.

type Service

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

Service loads Vertex and MonoVertex CRs and maps them to API v2 DTOs.

func NewService

func NewService(numaflowClient dfv1clients.NumaflowV1alpha1Interface) (*Service, error)

NewService constructs the observability application service.

func (*Service) GetMonoVertexStatus

func (s *Service) GetMonoVertexStatus(ctx context.Context, namespace, monoVertex string) (Result[VertexStatus], error)

GetMonoVertexStatus returns bounded Kubernetes MonoVertex CR status. It excludes live Pod inspection and daemon data-flow health. DaemonHealthy, when present, is a condition copied from that CR.

func (*Service) GetMonoVertexSummary

func (s *Service) GetMonoVertexSummary(ctx context.Context, namespace, monoVertex string) (Result[VertexSummary], error)

GetMonoVertexSummary returns a compact summary for one MonoVertex.

func (*Service) GetPipelineVertexStatus

func (s *Service) GetPipelineVertexStatus(ctx context.Context, namespace, pipeline, vertex string) (Result[VertexStatus], error)

GetPipelineVertexStatus returns bounded Kubernetes Vertex CR status for one pipeline vertex. It uses the same logical-name validation as summary and excludes live Pod inspection and daemon data-flow health.

func (*Service) GetPipelineVertexSummary

func (s *Service) GetPipelineVertexSummary(ctx context.Context, namespace, pipeline, vertex string) (Result[VertexSummary], error)

GetPipelineVertexSummary returns a compact summary for one pipeline vertex.

type TargetKind

type TargetKind string
const (
	TargetKindVertex     TargetKind = "Vertex"
	TargetKindMonoVertex TargetKind = "MonoVertex"
)

type TargetRef

type TargetRef struct {
	Kind      TargetKind
	Namespace string
	// Pipeline is set for Vertex targets and empty for MonoVertex targets.
	Pipeline string
	Name     string
	UID      string
}

type VertexStatus

type VertexStatus struct {
	Ref                TargetRef
	Phase              string
	DesiredPhase       string
	Reason             string
	Message            string
	Replicas           ReplicaStatus
	Conditions         []Condition
	Generation         int64
	ObservedGeneration int64
	ObservedAt         time.Time
	TruncatedFields    []string
}

VertexStatus is the detailed Kubernetes CR status projection for a pipeline vertex or MonoVertex. It does not include live Pod inspection or daemon data-flow health.

type VertexSummary

type VertexSummary struct {
	Ref                TargetRef
	VertexType         string
	Phase              string
	DesiredPhase       string
	Health             Health
	Generation         int64
	ObservedGeneration int64
	CreatedAt          time.Time
	ObservedAt         time.Time
	LastScaledAt       *time.Time
	// Capabilities lists follow-up actions available for this target (e.g. "summary", "status").
	// This is separate from GET /capabilities operations (OpenAPI operationIds).
	Capabilities    []string
	TruncatedFields []string
}

VertexSummary is the compact projection returned by summary APIs (not a CR dump).

Jump to

Keyboard shortcuts

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