Documentation
¶
Index ¶
- func ServersQuery(dbName, where string) string
- func WhereClause(scope QueryScope, extraConditions ...string) (string, []any)
- type ActorUsage
- type DecisionUsage
- type PrincipalScope
- type QueryScope
- type RecentActivity
- type ServerUsage
- type Service
- type TimePoint
- type ToolUsage
- type Totals
- type UsageFilters
- type UsageResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServersQuery ¶
func WhereClause ¶
func WhereClause(scope QueryScope, extraConditions ...string) (string, []any)
Types ¶
type ActorUsage ¶
type DecisionUsage ¶
type PrincipalScope ¶
func PrincipalOwnedScope ¶
func PrincipalOwnedScope(p platformauth.Principal) PrincipalScope
type QueryScope ¶
type QueryScope struct {
Since time.Time
WindowDays int
Limit int
Namespaces []string
TeamIDs []string
Server string
Decision string
ToolName string
}
func (QueryScope) Filters ¶
func (scope QueryScope) Filters() UsageFilters
type RecentActivity ¶
type RecentActivity struct {
Timestamp time.Time `json:"timestamp"`
Server string `json:"server,omitempty"`
Namespace string `json:"namespace,omitempty"`
TeamID string `json:"team_id,omitempty"`
HumanID string `json:"human_id,omitempty"`
AgentID string `json:"agent_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
Decision string `json:"decision,omitempty"`
ToolName string `json:"tool_name,omitempty"`
EventType string `json:"event_type,omitempty"`
}
type ServerUsage ¶
type ServerUsage struct {
Server string `json:"server"`
Namespace string `json:"namespace"`
TeamID string `json:"team_id,omitempty"`
Events uint64 `json:"events"`
Allowed uint64 `json:"allowed"`
Denied uint64 `json:"denied"`
UniqueHumans uint64 `json:"unique_humans"`
UniqueAgents uint64 `json:"unique_agents"`
LastSeen time.Time `json:"last_seen"`
}
type Service ¶
type Service struct {
DB clickhouse.Conn
DBName string
Resolver identity.Resolver
}
func (*Service) HandleAdminUsage ¶
func (s *Service) HandleAdminUsage(w http.ResponseWriter, r *http.Request)
func (*Service) HandleUserUsage ¶
func (s *Service) HandleUserUsage(w http.ResponseWriter, r *http.Request)
type UsageFilters ¶
type UsageResponse ¶
type UsageResponse struct {
Totals Totals `json:"totals"`
Servers []ServerUsage `json:"servers"`
Actors []ActorUsage `json:"actors"`
Tools []ToolUsage `json:"tools"`
Decisions []DecisionUsage `json:"decisions"`
Series []TimePoint `json:"series,omitempty"`
Recent []RecentActivity `json:"recent,omitempty"`
WindowDays int `json:"window_days"`
Filters UsageFilters `json:"filters,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.