Skip to content

Conversation

@jabellard
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 18, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chaunceyjiang for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @jabellard, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the observability of the karmada-apiserver by adding a dedicated Grafana dashboard. This new dashboard provides a holistic view of the API server's operational state, covering critical performance indicators, request patterns, and underlying resource utilization, allowing for more effective monitoring and troubleshooting.

Highlights

  • New Grafana Dashboard: Introduced a comprehensive Grafana dashboard specifically for monitoring the karmada-apiserver component, enhancing observability.
  • Detailed Metrics: The dashboard provides a wide array of metrics, including API server performance, request latency, error rates, request mix, payload sizes, admission/audit/watch events, etcd interactions, and Go runtime statistics.
  • Improved Observability: This addition enables users to gain deeper insights into the health, performance, and operational characteristics of the Karmada API server.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@karmada-bot karmada-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 18, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Grafana dashboard for the karmada-apiserver component, along with accompanying README files. The dashboard provides valuable insights into the apiserver's performance and health.

My review focuses on ensuring consistency and correctness. I've pointed out a bug in a PromQL query for the version panel that would cause it to fail, and suggested using the karmada_build_info metric for consistency with other Karmada components. I've also made minor suggestions to add missing newlines to the new markdown files.

"targets": [
{
"refId": "A",
"expr": "sum by (git_version) ( kubernetes_build_info{})",

Choose a reason for hiding this comment

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

high

This PromQL query is incorrect. The kubernetes_build_info metric uses a gitVersion label (camelCase), but the query attempts to group by git_version (snake_case). This will cause the panel to fail to display the version information.

For consistency with other Karmada components like karmada-controller-manager, please use the karmada_build_info metric, which correctly uses the git_version label. If karmada-apiserver does not yet expose this metric, it should be updated to do so. This change will improve monitoring consistency across the project.

Additionally, the extra spaces in the query should be removed for cleanliness.

Suggested change
"expr": "sum by (git_version) ( kubernetes_build_info{})",
"expr": "sum by (git_version) (karmada_build_info{})",

@@ -0,0 +1,3 @@
# Grafana Dashboards

This directory contains Grafana dashboards for monitoring and visualizing the operational state of Karmada components. No newline at end of file

Choose a reason for hiding this comment

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

medium

Please add a newline at the end of the file to adhere to common file formatting conventions.

Suggested change
This directory contains Grafana dashboards for monitoring and visualizing the operational state of Karmada components.
This directory contains Grafana dashboards for monitoring and visualizing the operational state of Karmada components.

@@ -0,0 +1,3 @@
# Karmada API Server Insights

Insights for Karmada API server. No newline at end of file

Choose a reason for hiding this comment

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

medium

Please add a newline at the end of the file to adhere to common file formatting conventions.

Suggested change
Insights for Karmada API server.
Insights for Karmada API server.

@jabellard
Copy link
Member Author

Hey @RainbowMango. Lately, I've been doing a lot of work to enhance observability for our managed multi-cluster platform built on top of Karmada, and will be sharing some of the dashboards I've built with the community. This is the first. I will have more coming!

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.64%. Comparing base (10a5f0f) to head (6825aa6).
⚠️ Report is 18 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6850      +/-   ##
==========================================
- Coverage   45.87%   45.64%   -0.23%     
==========================================
  Files         690      692       +2     
  Lines       57392    57703     +311     
==========================================
+ Hits        26331    26341      +10     
- Misses      29425    29717     +292     
- Partials     1636     1645       +9     
Flag Coverage Δ
unittests 45.64% <ø> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhzhuang-zju
Copy link
Contributor

This is the first. I will have more coming!

@jabellard That looks great! Could we use an issue to track and document these tasks?

@RainbowMango
Copy link
Member

Thanks @jabellard, interesting. But I don't get how to run it if I want to explore it on my side. Are you going to add more guides or demonstrate at the community meeting?

@jabellard
Copy link
Member Author

Thanks @jabellard, interesting. But I don't get how to run it if I want to explore it on my side. Are you going to add more guides or demonstrate at the community meeting?

Hey @RainbowMango. I've been building dashboards to enhance observability for our managed Karmada platform and will be sharing some of them with the community. The ones I have shared so far are ready for use, but with the assumption that a Prometheus stack has already been setup and is scraping metrics from the Karmada control plane component pods.

I'd love to show these dashboards in action on our managed Karmada platform, but unfortunately can't present internal systems without approval. I will be submitting a proposal for KubeCon EU Observability Day to showcase that work. I'm exited about that and will share the proposal with you soon.

For now, here's what I can do:

  • Create a new script or extend one of the existing scripts (e.g., hack/local_up_karmada.sh) to install the Kube Prom stack in a host Kind cluster
  • Configure scraping of metrics for the control plane components of a Karmada isntance running in that host cluster
  • Import the Grafana dashboards
  • Show the dashboards in action at a community meeting

What do you think?

/cc @zhzhuang-zju

@zhzhuang-zju
Copy link
Contributor

@jabellard Thank you for your detailed response and for looking forward to the proposal.

Create a new script or extend one of the existing scripts (e.g., hack/local_up_karmada.sh) to install the [Kube Prom stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) in a host Kind cluster

I prefer creating a new script that installs the Kube Prom stack to a cluster where Karmada is already installed. This approach would make the script more versatile. For other matters, I don't have any issues, but I believe we need a comprehensive guide covering the entire process from installation to getting Grafana up and running. I noticed that you've documented a documentation task in issue #6852, which is great.

@jabellard
Copy link
Member Author

@jabellard Thank you for your detailed response and for looking forward to the proposal.

Create a new script or extend one of the existing scripts (e.g., hack/local_up_karmada.sh) to install the [Kube Prom stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) in a host Kind cluster

I prefer creating a new script that installs the Kube Prom stack to a cluster where Karmada is already installed. This approach would make the script more versatile. For other matters, I don't have any issues, but I believe we need a comprehensive guide covering the entire process from installation to getting Grafana up and running. I noticed that you've documented a documentation task in issue #6852, which is great.

Yeah. I can do that. @RainbowMango , thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants