Skip to content

feat(teams): update metrics & alerts#1969

Merged
IvoGoman merged 2 commits intomainfrom
refactor/metrics/team
May 6, 2026
Merged

feat(teams): update metrics & alerts#1969
IvoGoman merged 2 commits intomainfrom
refactor/metrics/team

Conversation

@IvoGoman
Copy link
Copy Markdown
Contributor

@IvoGoman IvoGoman commented May 5, 2026

  • rename the namespace label to organization to better reflect the semantics
  • stop exposing time series for deleted objects
  • update alert to avoid flapping due to gaps in metrics between restarts

Signed-off-by: Ivo Gosemann ivo.gosemann@sap.com

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

Copilot AI review requested due to automatic review settings May 5, 2026 14:11
@IvoGoman IvoGoman requested a review from a team as a code owner May 5, 2026 14:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates “team” and “team RBAC” Prometheus metrics and their consumers (alerts/dashboards) to use an organization label instead of namespace, stops exposing metrics for deleted objects, and adjusts alerting to reduce flapping across controller restarts.

Changes:

  • Renamed Prometheus metric label namespaceorganization for team/teamrbac metrics, and updated alert rules + dashboard queries accordingly.
  • Added explicit metric deletion on Team / TeamRoleBinding deletion to avoid lingering time series for deleted objects.
  • Updated GreenhouseTeamRoleBindingNotReady alert to use min_over_time(...) to bridge scrape gaps during restarts.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/controller/teamrbac/teamrolebinding_controller.go Deletes team RBAC metrics when a TeamRoleBinding is fully deleted.
internal/controller/teamrbac/metrics.go Renames the label to organization and adds a helper to delete TeamRoleBinding metrics.
internal/controller/team/team_controller.go Deletes team member count metrics when a Team is deleted.
internal/controller/team/metrics.go Renames the label to organization and adds a helper to delete Team metrics.
charts/manager/alerts/team.alerts Updates rules to the new label and reduces flapping via min_over_time.
charts/greenhouse/perses-dashboards/organization.json Updates label usage in queries/columns/descriptions to organization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/team/team_controller.go
Comment thread charts/greenhouse/perses-dashboards/organization.json Outdated
Comment thread charts/greenhouse/perses-dashboards/organization.json Outdated
@IvoGoman IvoGoman force-pushed the refactor/metrics/team branch 2 times, most recently from cd53d62 to 0470b72 Compare May 5, 2026 14:41
IvoGoman and others added 2 commits May 6, 2026 14:02
- rename the namespace label to organization to better reflect the semantics
- stop exposing time series for deleted objects
- update alert to avoid flapping due to gaps in metrics between restarts

Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
@IvoGoman IvoGoman force-pushed the refactor/metrics/team branch from 3a5666b to 4bbfe4f Compare May 6, 2026 12:02
@IvoGoman IvoGoman merged commit 848a116 into main May 6, 2026
24 checks passed
@IvoGoman IvoGoman deleted the refactor/metrics/team branch May 6, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants