Documentation
¶
Index ¶
- func HealthHandler() http.HandlerFunc
- func InitMetrics()
- func LivenessHandler() http.HandlerFunc
- func MetricsHandler() http.Handler
- func ReadinessHandler() http.HandlerFunc
- func RecordAgentExecution(agent string, duration time.Duration)
- func RecordAgentMessage(agent, msgType string)
- func RecordGRPCRequest(method, status string, duration time.Duration)
- func RecordHTTPRequest(method, path, status string, duration time.Duration)
- func RecordMCPToolCall(tool, status string, duration time.Duration)
- func SetActiveConnections(count int)
- func SetGoroutines(count int)
- func SetMemoryUsage(bytes uint64)
- type CheckStatus
- type HealthCheck
- type HealthChecker
- type HealthResponse
- type HealthStatus
- type Server
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthHandler ¶
func HealthHandler() http.HandlerFunc
HealthHandler returns an HTTP handler for health checks
func LivenessHandler ¶
func LivenessHandler() http.HandlerFunc
LivenessHandler returns a simple liveness probe handler
func MetricsHandler ¶
MetricsHandler returns an HTTP handler for Prometheus metrics
func ReadinessHandler ¶
func ReadinessHandler() http.HandlerFunc
ReadinessHandler returns a readiness probe handler
func RecordAgentExecution ¶
RecordAgentExecution records agent execution metrics
func RecordAgentMessage ¶
func RecordAgentMessage(agent, msgType string)
RecordAgentMessage records agent message metrics
func RecordGRPCRequest ¶
RecordGRPCRequest records gRPC request metrics
func RecordHTTPRequest ¶
RecordHTTPRequest records HTTP request metrics
func RecordMCPToolCall ¶
RecordMCPToolCall records MCP tool call metrics
func SetActiveConnections ¶
func SetActiveConnections(count int)
SetActiveConnections sets the active connections gauge
Types ¶
type CheckStatus ¶
type CheckStatus struct {
Status HealthStatus `json:"status"`
Message string `json:"message,omitempty"`
LastChecked time.Time `json:"last_checked"`
Duration string `json:"duration,omitempty"`
}
CheckStatus represents the status of a health check
type HealthCheck ¶
type HealthCheck struct {
Name string
CheckFunc func(context.Context) error
Timeout time.Duration
Critical bool
// contains filtered or unexported fields
}
HealthCheck represents a single health check
func DatabaseCheck ¶
func DatabaseCheck(pingFunc func(context.Context) error) *HealthCheck
DatabaseCheck creates a database health check
func ExternalServiceCheck ¶
func ExternalServiceCheck(name string, checkFunc func(context.Context) error) *HealthCheck
ExternalServiceCheck creates an external service health check
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker manages health checks
func GetHealthChecker ¶
func GetHealthChecker() *HealthChecker
GetHealthChecker returns the global health checker
func InitHealthChecker ¶
func InitHealthChecker() *HealthChecker
InitHealthChecker initializes the global health checker
func (*HealthChecker) Check ¶
func (hc *HealthChecker) Check(ctx context.Context) HealthResponse
Check performs all health checks
func (*HealthChecker) RegisterCheck ¶
func (hc *HealthChecker) RegisterCheck(check *HealthCheck)
RegisterCheck registers a new health check
type HealthResponse ¶
type HealthResponse struct {
Status HealthStatus `json:"status"`
Timestamp time.Time `json:"timestamp"`
Version string `json:"version"`
Uptime time.Duration `json:"uptime"`
Checks map[string]CheckStatus `json:"checks"`
System SystemInfo `json:"system"`
}
HealthResponse represents the health check response
type HealthStatus ¶
type HealthStatus string
HealthStatus represents the health status of the service
const ( HealthStatusHealthy HealthStatus = "healthy" HealthStatusDegraded HealthStatus = "degraded" HealthStatusUnhealthy HealthStatus = "unhealthy" )