package observability import "runtime" var methods = []string{"GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", "OTHER"} var routes = []string{"health_live", "health_ready", "worker_connect", "event_connect", "tasks", "queues", "workflows", "workflow_definitions", "schedules", "subscriptions", "application_resources", "other"} var statusClasses = []string{"1xx", "2xx", "3xx", "4xx", "5xx", "other"} var components = []string{"workflow", "schedule", "execution_recovery"} // Every exported family is declared here, including each allowed label value. // Adding a metric therefore requires a code review; no user identifier is valid. func catalog() map[string]descriptor { httpLabels := map[string][]string{"method": methods, "route": routes, "status_class": statusClasses} c := map[string]descriptor{ "orbit_http_requests_total": {counter, "Completed HTTP responses, including successful upgrade handshakes", httpLabels}, "orbit_http_request_duration_seconds": {histogram, "HTTP response or upgrade handshake duration in seconds", httpLabels}, "orbit_http_requests_in_flight": {gauge, "HTTP handlers before completion or successful hijack", nil}, "orbit_http_panics_total": {counter, "HTTP handlers which panicked, before or after upgrade", nil}, "orbit_websocket_connections": {gauge, "Upgraded WebSocket handlers currently active", map[string][]string{"route": {"worker_connect", "event_connect"}}}, "orbit_websocket_connections_total": {counter, "Successful WebSocket upgrades", map[string][]string{"route": {"worker_connect", "event_connect"}}}, "orbit_runtime_batch_total": {counter, "Completed background batches by outcome", map[string][]string{"component": components, "outcome": {"success", "error", "cancelled"}}}, "orbit_runtime_batch_duration_seconds": {histogram, "Background batch duration in seconds", map[string][]string{"component": components}}, "orbit_runtime_batch_last_success_timestamp_seconds": {gauge, "Unix time of last successful background batch, zero before first success", map[string][]string{"component": components}}, "orbit_process_start_time_seconds": {gauge, "Unix time when the Orbit metrics registry was started", nil}, "orbit_process_uptime_seconds": {gauge, "Monotonic elapsed time since metrics registry startup", nil}, "orbit_go_goroutines": {gauge, "Current Go goroutine count", nil}, "orbit_build_info": {gauge, "Orbit Go runtime build information", map[string][]string{"go_version": {runtime.Version()}}}, } for name, help := range map[string]string{ "open": "Open MySQL connections", "in_use": "MySQL connections currently in use", "idle": "Idle MySQL connections", "max_open": "Configured maximum open MySQL connections", } { c["orbit_db_connections_"+name] = descriptor{gauge, help, nil} } c["orbit_db_wait_count_total"] = descriptor{counter, "Cumulative waits for a MySQL connection", nil} c["orbit_db_wait_duration_seconds_total"] = descriptor{counter, "Cumulative seconds waiting for a MySQL connection", nil} return c }