mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(api): add dashboard summary and system realtime endpoints
Add new admin API endpoints for dashboard metrics and system-wide realtime statistics: - Add /admin/dashboard/summary endpoint with aggregated metrics including requests, tokens, latency, masters, keys, and provider keys statistics with time period filtering - Add /admin/realtime endpoint for system-level realtime stats aggregated across all masters - Add status filter parameter to ListAPIKeys endpoint - Add hour grouping option to log stats aggregation - Update OpenAPI documentation with new endpoints and schemas
This commit is contained in:
@@ -219,6 +219,7 @@ func main() {
|
||||
handler := api.NewHandler(db, logDB, syncService, logWriter, rdb, logPartitioner)
|
||||
adminHandler := api.NewAdminHandler(db, logDB, masterService, syncService, statsService, logPartitioner)
|
||||
masterHandler := api.NewMasterHandler(db, logDB, masterService, syncService, statsService, logPartitioner)
|
||||
dashboardHandler := api.NewDashboardHandler(db, logDB, statsService, logPartitioner)
|
||||
internalHandler := api.NewInternalHandler(db)
|
||||
featureHandler := api.NewFeatureHandler(rdb)
|
||||
authHandler := api.NewAuthHandler(db, rdb, adminService, masterService)
|
||||
@@ -354,6 +355,8 @@ func main() {
|
||||
adminGroup.GET("/logs/webhook", handler.GetLogWebhookConfig)
|
||||
adminGroup.PUT("/logs/webhook", handler.UpdateLogWebhookConfig)
|
||||
adminGroup.GET("/stats", adminHandler.GetAdminStats)
|
||||
adminGroup.GET("/realtime", adminHandler.GetAdminRealtime)
|
||||
adminGroup.GET("/dashboard/summary", dashboardHandler.GetSummary)
|
||||
adminGroup.GET("/apikey-stats/summary", adminHandler.GetAPIKeyStatsSummary)
|
||||
adminGroup.POST("/bindings", handler.CreateBinding)
|
||||
adminGroup.GET("/bindings", handler.ListBindings)
|
||||
|
||||
Reference in New Issue
Block a user