Skip to content

Fix /metrics page for non-integer stats

Michał Wielich requested to merge fix-metrics-error into main

Summary

Related to #48 (closed)

After deploying !208 (merged) to staging, we have an error on /metrics page: https://gitlab-org-gitlab-services-version-gitlab-com-staging.version-staging.gitlab.org/metrics

This MR fixes that bug.

Another option is to fully remove the /metrics page, but we would first need to investigate if there's anyone using it.

How to replicate the bug

  1. Run this in the console to make sure u get non-integer stats:
ul = UsageData.last
ul.update!(stats: ul.stats.merge(epics: {"base_attributes":0,"epic_hierarchy":0,"issue_hierarchy":0,"related_links":0}), recorded_at: 10.days.ago)
  1. Go to the /metrics page locally. If it loads without an error, the bug has been resolved.

  • I made sure there are no unverified deployments on staging in #version-gitlab-com Slack channel before merging this MR
Edited by Michał Wielich

Merge request reports

Loading