Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace         = "kubeskoop"
	ExporterConfigMap = "kubeskoop-config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureArgs

type CaptureArgs struct {
	CaptureList []struct {
		Type      string `json:"type"`
		Name      string `json:"name"`
		Nodename  string `json:"nodename"`
		Namespace string `json:"namespace"`
	} `json:"capture_list"`
	CaptureDurationSeconds int    `json:"capture_duration_seconds"`
	Filter                 string `json:"filter"`
}

type CaptureTaskResult

type CaptureTaskResult struct {
	TaskID  int       `json:"task_id"`
	Spec    *TaskSpec `json:"spec"`
	Status  string    `json:"status"`
	Result  string    `json:"result"`
	Message string    `json:"message"`
}

todo reflect to generic task definition

type Config added in v1.0.1

type Config struct {
	Namespace  string          `yaml:"namespace"`
	KubeConfig string          `yaml:"kubeConfig"`
	Prometheus string          `yaml:"prometheus"`
	Loki       string          `yaml:"loki"`
	DB         db.Config       `yaml:"database"`
	Diagnose   diagnose.Config `yaml:"diagnose"`
}

type ControllerService

type ControllerService interface {
	rpc.ControllerRegisterServiceServer
	GetAgentList() []*rpc.AgentInfo
	Capture(ctx context.Context, capture *CaptureArgs) (int, error)
	CaptureList(ctx context.Context) (map[int][]*CaptureTaskResult, error)
	QueryRangeEvent(ctx context.Context, start, end time.Time, filters map[string][]string, limit int) ([]Event, error)
	Diagnose(ctx context.Context, args *skoopContext.TaskConfig) (int64, error)
	DiagnoseList(ctx context.Context) ([]DiagnoseTaskResult, error)
	DownloadCaptureFile(ctx context.Context, id int) (string, int64, io.ReadCloser, error)
	PodList(ctx context.Context) ([]*Pod, error)
	NodeList(ctx context.Context) ([]*Node, error)
	NamespaceList(ctx context.Context) ([]string, error)
	QueryPrometheus(ctx context.Context, query string, ts time.Time) (model.Value, promv1.Warnings, error)
	GetPodNodeInfoFromMetrics(ctx context.Context, ts time.Time) (model.Vector, model.Vector, error)
	PingMesh(ctx context.Context, pingmesh *PingMeshArgs) (*PingMeshResult, error)
	GetExporterConfig(ctx context.Context) (*exporter.InspServerConfig, error)
	UpdateExporterConfig(ctx context.Context, cfg *exporter.InspServerConfig) error
}

func NewControllerService

func NewControllerService(k8sClient *kubernetes.Clientset, config *Config) (ControllerService, error)

type DiagnoseTaskResult

type DiagnoseTaskResult struct {
	TaskID     int64   `json:"task_id" db:"id"`
	TaskConfig string  `json:"task_config" db:"config"`
	StartTime  string  `json:"start_time" db:"start_time"`
	FinishTime *string `json:"finish_time" db:"finish_time"`
	Status     string  `json:"status" db:"status"`
	Result     *string `json:"result" db:"result"`
	Message    *string `json:"message" db:"message"`
}

todo reflect to generic task definition

type Event

type Event struct {
	Node string `json:"node"`
	Time int    `json:"time"`
	probe.Event
}

type Latency

type Latency struct {
	Source     *NodeInfo `json:"source"`
	Target     *NodeInfo `json:"destination"`
	LatencyMax float64   `json:"latency_max"`
	LatencyMin float64   `json:"latency_min"`
	LatencyAvg float64   `json:"latency_avg"`
}

type Node

type Node struct {
	Name   string            `json:"name"`
	Labels map[string]string `json:"labels"`
}

type NodeInfo

type NodeInfo struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	Nodename  string `json:"nodename"`
	Namespace string `json:"namespace"`
}

type PingMeshArgs

type PingMeshArgs struct {
	PingMeshSourceList []NodeInfo `json:"ping_mesh_source_list"`
	PingMeshList       []NodeInfo `json:"ping_mesh_list"`
}

type PingMeshResult

type PingMeshResult struct {
	Nodes []NodeInfo `json:"nodes"`
	//unit ms
	Latencies []Latency `json:"latencies"`
}

type Pod

type Pod struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Nodename  string            `json:"nodename"`
	Labels    map[string]string `json:"labels"`
}

type TaskSpec

type TaskSpec struct {
	TaskType  string `json:"task_type"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

Jump to

Keyboard shortcuts

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