(db *sql.DB)
| 131 | } |
| 132 | |
| 133 | func handleCounts(db *sql.DB) http.HandlerFunc { |
| 134 | return func(w http.ResponseWriter, r *http.Request) { |
| 135 | var exceptions, traces, logs int |
| 136 | db.QueryRow(`SELECT COUNT(*) FROM sentry_error_events`).Scan(&exceptions) |
| 137 | db.QueryRow(`SELECT COUNT(*) FROM sentry_traces`).Scan(&traces) |
| 138 | db.QueryRow(`SELECT COUNT(*) FROM sentry_logs`).Scan(&logs) |
| 139 | |
| 140 | apiJSON(w, map[string]any{ |
| 141 | "exceptions": exceptions, |
| 142 | "traces": traces, |
| 143 | "logs": logs, |
| 144 | }) |
| 145 | } |
| 146 | } |
no test coverage detected