Documentation
¶
Index ¶
- Variables
- func Handler() http.Handler
- func RecordAgentFailure(id, agentType, reason string)
- func RecordAgentStart(id, agentType string)
- func RecordAgentStateChange(id, agentType, oldState, newState string)
- func RecordAgentStop(id, agentType string)
- func RecordEvent(topic string)
- func UpdateAgentResources(id, agentType string, cpuUsage float64, memoryBytes uint64, ...)
- func UpdateSubscriberCount(topic string, count int)
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // Build Info BuildInfo = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_build_info", Help: "Supervisor build information", }, []string{"version", "commit", "go_version"}, ) // Supervisor Metrics SupervisorUptime = factory.NewGauge( prometheus.GaugeOpts{ Name: "gapi_supervisor_uptime_seconds", Help: "Supervisor uptime in seconds", }, ) AgentsTotal = factory.NewGauge( prometheus.GaugeOpts{ Name: "gapi_supervisor_agents_total", Help: "Total number of registered agents", }, ) // Agent Lifecycle Metrics AgentState = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_agent_state", Help: "Current state of agents (1 = in this state, 0 = not)", }, []string{"id", "type", "state"}, ) AgentStarts = factory.NewCounterVec( prometheus.CounterOpts{ Name: "gapi_agent_starts_total", Help: "Total number of agent starts", }, []string{"id", "type"}, ) AgentStops = factory.NewCounterVec( prometheus.CounterOpts{ Name: "gapi_agent_stops_total", Help: "Total number of agent stops", }, []string{"id", "type"}, ) AgentFailures = factory.NewCounterVec( prometheus.CounterOpts{ Name: "gapi_agent_failures_total", Help: "Total number of agent failures", }, []string{"id", "type", "reason"}, ) // Resource Usage Metrics AgentCPUUsage = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_agent_cpu_usage", Help: "Agent CPU usage percentage", }, []string{"id", "type"}, ) AgentMemoryBytes = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_agent_memory_bytes", Help: "Agent memory usage in bytes", }, []string{"id", "type"}, ) AgentUptimeSeconds = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_agent_uptime_seconds", Help: "Agent uptime in seconds", }, []string{"id", "type"}, ) // EventBus Metrics EventBusEvents = factory.NewCounterVec( prometheus.CounterOpts{ Name: "gapi_eventbus_events_total", Help: "Total number of events published", }, []string{"topic"}, ) EventBusSubscribers = factory.NewGaugeVec( prometheus.GaugeOpts{ Name: "gapi_eventbus_subscribers", Help: "Number of active subscribers per topic", }, []string{"topic"}, ) )
The gapi_ metric NAMES below are deliberately not product-namespaced, and this is an exclusion rather than an oversight (GAPI-DIV-061).
A metric name is scraped: it is referenced by dashboards, recording rules and alerts that live outside this repo, so renaming one breaks consumers exactly the way renaming an ALPN or a protobuf package would. They belong to the WIRE class. The HELP text next to them does not - nobody alerts on help text - which is why the two lines that spelled the vendor there now name the role instead.
var Registry = prometheus.NewRegistry()
Registry is a dedicated registry for all GAPI metrics. Registering against it (rather than prometheus.DefaultRegisterer) means host applications that embed GAPI and replace the default registry still expose GAPI metrics via Handler().
Functions ¶
func RecordAgentFailure ¶
func RecordAgentFailure(id, agentType, reason string)
RecordAgentFailure increments agent failure counter
func RecordAgentStart ¶
func RecordAgentStart(id, agentType string)
RecordAgentStart increments agent start counter
func RecordAgentStateChange ¶
func RecordAgentStateChange(id, agentType, oldState, newState string)
RecordAgentStateChange updates agent state metrics
func RecordAgentStop ¶
func RecordAgentStop(id, agentType string)
RecordAgentStop increments agent stop counter
func UpdateAgentResources ¶
func UpdateAgentResources(id, agentType string, cpuUsage float64, memoryBytes uint64, uptimeSeconds float64)
UpdateAgentResources updates agent resource usage metrics
func UpdateSubscriberCount ¶
UpdateSubscriberCount updates subscriber count for a topic