Skip to content

feat: Show pod requests and limits on component/service metrics views - #4337

Merged
michaeljguarino merged 6 commits into
masterfrom
marcin/prod-5130-pod-limits-and-and-requests-in-componentetc-metrics-views
Sep 18, 2026
Merged

michaeljguarino merged 6 commits into
masterfrom
marcin/prod-5130-pod-limits-and-and-requests-in-componentetc-metrics-views

Conversation

@maciaszczykm

Copy link
Copy Markdown
Member

Test Plan

Test environment: https://console.your-env.onplural.sh/

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • If required, I have updated the Plural documentation accordingly.
  • I have added tests to cover my changes.
  • I have deployed the agent to a test environment and verified that it works as expected (required only when changing agent code).

Plural Flow: console

@linear

linear Bot commented Sep 15, 2026

Copy link
Copy Markdown

PROD-5130

@soffi-ai

soffi-ai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Soffi AI Summary

This PR surfaces Kubernetes pod resource requests and limits alongside existing CPU/memory usage metrics in the component, service, and cluster metrics views. Previously, users could only see raw utilization; now they can compare actual usage against configured requests and limits directly in the UI charts.

The change is full-stack: new Prometheus queries for requests/limits are added to the Elixir metrics backend, the GraphQL schema is extended with cpuRequests, cpuLimits, memRequests, memLimits, podCpuRequests, podCpuLimits, podMemRequests, and podMemLimits fields on both ServiceComponentMetrics and KubernetesControllerMetrics, the Go client models are regenerated, and the React metric graph components are updated to fetch and render these new series. A Kubernetes spec fallback is also implemented so that if Prometheus data is unavailable, the UI can still display the limits/requests values derived from the pod spec.

Changes

Pod resource requests and limits in metrics views

  • Adds Prometheus queries for CPU/memory requests and limits (both controller-level and pod-level) to the Elixir observability metrics module, and exposes the new fields in the GraphQL schema for ServiceComponentMetrics and KubernetesControllerMetrics. (22fc4de)
  • Wires the new requests/limits metric fields through the GraphQL fragments and React components (ServiceMetrics, ComponentMetrics, KubernetesMetrics, ResourceMetricsGraphs), rendering them as additional series on the existing CPU/memory charts with a fallback to Kubernetes pod spec values when Prometheus data is absent. Regenerates the Go client models and TypeScript GraphQL types. (7ac6bd5)
  • Merge commit integrating upstream master changes into the feature branch. (354783a)

Updated: 2026-09-16 14:36 UTC

Deploy in Soffi

@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm maciaszczykm added the enhancement New feature or request label Sep 15, 2026
@greptile-apps

greptile-apps Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness or repository-rule issues identified.

Summary

The PR extends service, component, and Kubernetes metrics views to display CPU and memory requests and limits alongside usage.

  • Adds Prometheus queries and GraphQL fields for aggregate and per-pod reservations.
  • Keeps backend schema, frontend operations, generated client types, and persisted queries synchronized.
  • Reuses shared resource graph rendering across metrics views.
  • Adds distinguishable backend assertions for all new metric mappings.
  • Updates empty-state detection so reservation-only data remains visible.

Reviews (3) · Last reviewed commit: "yarn fix"

Comment thread js/console/src/components/cd/services/service/ServiceMetrics.tsx Outdated
Comment thread test/console/graphql/queries/deployments/service_queries_test.exs Outdated
@maciaszczykm

Copy link
Copy Markdown
Member Author

@greptileai

@maciaszczykm
maciaszczykm marked this pull request as ready for review September 17, 2026 09:12
@maciaszczykm
maciaszczykm requested review from a team as code owners September 17, 2026 09:12
@michaeljguarino

Copy link
Copy Markdown
Member

can i have a screenshot of the change here? This was sort of being done already

@maciaszczykm

Copy link
Copy Markdown
Member Author

@michaeljguarino Before, requests and limits were flat lines from the current pod spec. This PR gets that data from Prometheus (with the spec as fallback on component and Kubernetes graphs), so when possible it shows real values over time. It also adds these lines to service graphs and to the overall CPU/memory charts.

Zrzut ekranu 2026-09-17 o 11 03 44 Zrzut ekranu 2026-09-17 o 11 05 55 Zrzut ekranu 2026-09-17 o 11 10 01

@michaeljguarino
michaeljguarino merged commit 0a36bfa into master Sep 18, 2026
69 checks passed
@michaeljguarino
michaeljguarino deleted the marcin/prod-5130-pod-limits-and-and-requests-in-componentetc-metrics-views branch September 18, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants