Skip to content

Migrate Redis metrics to internal events for Envionments

Ankit Panchal requested to merge 448288-envionments-redis-migrate into master

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.

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

  1. 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
    }
}'
  1. Run rails runner scripts/internal_events/monitor.rb track_agents_ci_tunnel to verify that events and metrics are being updated.

Related to #448288

Edited by Ankit Panchal

Merge request reports