Migrate Redis metrics to internal events for Envionments
What does this MR do and why?
This migrates the below total count metric to Internal Events, while keeping the original Redis key. Instead of migrating the key to the new format in TotalCountMetric
, the new key is aliased in a YAML file and points to the old one, so that the count continues in the old key and we can keep the past count.
counts.kubernetes_agent_flux_git_push_notifications_total
counts.kubernetes_agent_k8s_api_proxy_request
counts.kubernetes_agent_k8s_api_proxy_requests_via_ci_access
counts.kubernetes_agent_k8s_api_proxy_requests_via_pat_access
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- copy below curl and send request.
curl --location --request POST 'http://localhost:3000/api/v4/internal/kubernetes/usage_metrics' \
--header 'Gitlab-Kas-Api-Request: <JWT token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"counters": {
"k8s_api_proxy_request": 117,
"flux_git_push_notifications_total": 120,
"k8s_api_proxy_requests_via_user_access": 111
}
}'
- Run
rails runner scripts/internal_events/monitor.rb track_agents_ci_tunnel
to verify that events and metrics are being updated.
Related to #448288 (closed)
Edited by Ankit Panchal