Skip to content

fix: correctly parse and render total metric values and labels (not just last label) in kof UI#486

Merged
AndrejsPon00 merged 1 commit into
k0rdent:mainfrom
AndrejsPon00:add-labels-to-metics
Aug 20, 2025
Merged

fix: correctly parse and render total metric values and labels (not just last label) in kof UI#486
AndrejsPon00 merged 1 commit into
k0rdent:mainfrom
AndrejsPon00:add-labels-to-metics

Conversation

@AndrejsPon00
Copy link
Copy Markdown
Contributor

@AndrejsPon00 AndrejsPon00 commented Aug 19, 2025

This PR fixes an issue where metrics with multiple labels were not parsed and rendered correctly. The UI previously receive and used a single (last) label value instead of aggregating and exposing all labels and values. The Prometheus parser, backend response format, and UI rendering were updated so metrics now include distinct label entries and a value.

Examples Prometheus metric input:

vl_data_size_bytes{type="indexdb"} 199695
vl_data_size_bytes{type="storage"} 125139890

Before (incorrect) metrics were parsed into a single numeric value:

"vl_data_size_bytes": 125139890

After (correct) backend now returns separated labels and values:

{
  "vl_data_size_bytes": [
    {
      "labels": { "type": "indexdb" },
      "value": 199695
    },
    {
      "labels": { "type": "storage" },
      "value": 125139890
    }
  ]
}
image

Comment thread kof-operator/internal/metrics/helper.go Outdated
Comment thread kof-operator/internal/metrics/types.go Outdated
@AndrejsPon00 AndrejsPon00 requested a review from gmlexx August 20, 2025 08:44
@AndrejsPon00 AndrejsPon00 added this pull request to the merge queue Aug 20, 2025
Merged via the queue into k0rdent:main with commit c0098ec Aug 20, 2025
5 checks passed
@github-project-automation github-project-automation Bot moved this to Done in k0rdent Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants