observability

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentBucket

type AgentBucket struct {
	AgentID   uint   `json:"agent_id"`
	AgentName string `json:"agent_name"`
	Occupied  int64  `json:"occupied"`
	Capacity  int64  `json:"capacity"`
	Waiters   int64  `json:"waiters"`
}

type AgentHealthRow

type AgentHealthRow struct {
	AgentID    string  `json:"agent_id"`
	Requests   int64   `json:"requests"`
	Failed     int64   `json:"failed"`
	ErrorRate  float64 `json:"error_rate"`
	QPS        float64 `json:"qps"`
	WindowSecs int     `json:"window_secs"`
}

AgentHealthRow 是某 agent 近窗健康原始信号(红黄绿由前端按 Settings 阈值算)。

type FailedAgent

type FailedAgent struct {
	AgentID   uint   `json:"agent_id"`
	AgentName string `json:"agent_name"`
	Error     string `json:"error"`
}

type Handler

type Handler struct {
	HubCall           func(agentID string, method string, params any, timeout time.Duration) (json.RawMessage, error)
	GetOnlineAgentIDs func() []string
}

Handler 持有扇出可观测 RPC 所需的 Hub 依赖(与 master/api/agent.Handler 同源装配)。

func (*Handler) GetLimiterUsage

func (h *Handler) GetLimiterUsage(c *app.Context, _ api.EmptyRequest) (LimiterUsageResponse, error)

func (*Handler) GetRecentHealth

func (h *Handler) GetRecentHealth(c *app.Context, _ api.EmptyRequest) (RecentHealthResponse, error)

GetRecentHealth 返回各 agent 近窗错误率/QPS。窗口取 health_window_seconds 设置(默认 300)。

type LimiterBucketRow

type LimiterBucketRow struct {
	protocol.LimiterBucketStat
	PerAgent []AgentBucket `json:"per_agent"`
}

LimiterBucketRow 是集群聚合后的一行 + per-agent 明细(饱和度看每节点,v1 本地执行=本地求和)。

type LimiterUsageResponse

type LimiterUsageResponse struct {
	Buckets      []LimiterBucketRow `json:"buckets"`
	FailedAgents []FailedAgent      `json:"failed_agents"`
}

type RecentHealthResponse

type RecentHealthResponse struct {
	Agents     []AgentHealthRow `json:"agents"`
	WindowSecs int              `json:"window_secs"`
}

Jump to

Keyboard shortcuts

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