Add usage metrics for Kubernetes Agent
FY21-Q3 OKR
Having at least 100 reporting agents
Proposal
Metrics to gather:
- number of registered Kubernetes Agents with valid tokens
- number of GitOps synchronization operations
Technical details
Number of registered Kubernetes Agents
Count of agents in the DB where an agent has at least one valid (not revoked, not expired) token.
GitOps synchronization operations
Should use Usage Ping, likely Redis counters.
Metrics:
- Redis
USAGE_K8S_AGENT_GITOPS_SYNC
- number of timeskas
sent "objects to synchronize" response toagentk
.N1
below.
kas
should make a POST
request to /api/v4/internal/kubernetes/usage_metrics
with the following JSON payload:
{
"gitops_sync_count": N1
}
The request must contain a valid JWT token to be accepted. All values in a request are increments to the corresponding currently stored values, not absolute counters. Each kas
instance will send such request as often as every 1 minute (configurable via kas
config). A request is sent only if the internal counter has increased since the last time it was sent.
Edited by Thong Kuah