Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OtelContextStartTime = time.Now()
Functions ¶
Types ¶
type GraphEdge ¶
type GraphEdge struct {
Source string `json:"source"`
Target string `json:"target"`
CallCount int64 `json:"call_count"`
AvgLatencyMs float64 `json:"avg_latency_ms"`
ErrorRate float64 `json:"error_rate"`
Status string `json:"status"`
}
GraphEdge represents a call relationship between two services.
type GraphNode ¶
type GraphNode struct {
ID string `json:"id"`
Type string `json:"type"`
HealthScore float64 `json:"health_score"`
Status string `json:"status"`
Metrics NodeMetrics `json:"metrics"`
Alerts []string `json:"alerts"`
}
GraphNode represents a service in the system graph.
type NodeMetrics ¶
type NodeMetrics struct {
RequestRateRPS float64 `json:"request_rate_rps"`
ErrorRate float64 `json:"error_rate"`
AvgLatencyMs float64 `json:"avg_latency_ms"`
P99LatencyMs float64 `json:"p99_latency_ms"`
SpanCount1H int64 `json:"span_count_1h"`
}
NodeMetrics holds per-service observability metrics.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter is a per-IP token bucket rate limiter middleware.
func NewRateLimiter ¶
func NewRateLimiter(rps float64) *RateLimiter
NewRateLimiter creates a RateLimiter with the given requests-per-second limit.
func (*RateLimiter) Middleware ¶
func (rl *RateLimiter) Middleware(next http.Handler) http.Handler
Middleware returns an http.Handler that enforces rate limiting.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles HTTP API requests.
func NewServer ¶
func NewServer(repo *storage.Repository, hub *realtime.Hub, eventHub *realtime.EventHub, metrics *telemetry.Metrics) *Server
NewServer creates a new API server.
func (*Server) BroadcastLog ¶
BroadcastLog sends a log entry to the buffered WebSocket hub.
func (*Server) RegisterRoutes ¶
RegisterRoutes registers API endpoints on the provided mux.
func (*Server) SetColdStoragePath ¶
SetColdStoragePath sets the base path for cold archive search.
func (*Server) SetVectorIndex ¶
SetVectorIndex wires the TF-IDF vector index for semantic log search.
type SystemGraphResponse ¶
type SystemGraphResponse struct {
Timestamp time.Time `json:"timestamp"`
System SystemSummary `json:"system"`
Nodes []GraphNode `json:"nodes"`
Edges []GraphEdge `json:"edges"`
}
SystemGraphResponse is the full AI-consumable system graph.
type SystemSummary ¶
type SystemSummary struct {
TotalServices int `json:"total_services"`
Healthy int `json:"healthy"`
Degraded int `json:"degraded"`
Critical int `json:"critical"`
OverallHealthScore float64 `json:"overall_health_score"`
TotalErrorRate float64 `json:"total_error_rate"`
AvgLatencyMs float64 `json:"avg_latency_ms"`
UptimeSeconds float64 `json:"uptime_seconds"`
}
SystemSummary is the top-level system health summary.