Documentation
¶
Index ¶
- Constants
- Variables
- func RecordError(errorCode string, httpStatus int)
- func RecordErrorByEndpoint(endpoint string, errorCode string)
- func RecordHealthCheck(checkName string, healthy bool, duration time.Duration)
- func RecordOperation(operation string, success bool)
- func RecordOperationError(operation string, errorType string)
- func RecordPanic()
- func SetActiveConnections(count int64)
- func SetServerStartTime(timestamp int64)
- func SetServerUptime(seconds int64)
Constants ¶
View Source
const ( ErrorsTotalName = "errors_total" PanicsTotalName = "panics_total" ErrorsByEndpointName = "errors_by_endpoint" )
Metric names
Variables ¶
View Source
var ( // Operations metrics OperationsTotal = "app_operations_total" OperationsErrorsTotal = "app_operations_errors_total" // Connection metrics ActiveConnections = "app_active_connections" // Health check metrics HealthCheckTotal = "app_health_check_total" HealthCheckDuration = "app_health_check_duration_ms" // Server lifecycle metrics ServerStartTime = "app_server_start_time_seconds" ServerUptime = "app_server_uptime_seconds" )
Application-level metrics following Prometheus conventions
Functions ¶
func RecordError ¶
RecordError records an error with code and status
func RecordErrorByEndpoint ¶
RecordErrorByEndpoint records an error by endpoint
func RecordHealthCheck ¶
RecordHealthCheck records a health check execution
func RecordOperation ¶
RecordOperation records an application operation with status
func RecordOperationError ¶
RecordOperationError records an application operation error
func SetActiveConnections ¶
func SetActiveConnections(count int64)
SetActiveConnections sets the current number of active connections
func SetServerStartTime ¶
func SetServerStartTime(timestamp int64)
SetServerStartTime records the server start time (Unix timestamp)
func SetServerUptime ¶
func SetServerUptime(seconds int64)
SetServerUptime records the server uptime in seconds
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.