Skip to content

Add KafkaNodePool resource count metric and fix dashboard defaults#12281

Merged
scholzj merged 1 commit intostrimzi:mainfrom
syedazeez337:fix/nodepool-metrics-and-dashboard-defaults
Jan 12, 2026
Merged

Add KafkaNodePool resource count metric and fix dashboard defaults#12281
scholzj merged 1 commit intostrimzi:mainfrom
syedazeez337:fix/nodepool-metrics-and-dashboard-defaults

Conversation

@syedazeez337
Copy link
Copy Markdown
Contributor

@syedazeez337 syedazeez337 commented Jan 1, 2026

  • Add nodePoolResourceCounter to KafkaAssemblyOperatorMetricsHolder
  • Override reconcileThese() in KafkaAssemblyOperator to count NodePools
  • Add unit tests for new metrics methods
  • Fix Kafka panel default from N/A to 0 for consistency

Fixes #12138

@syedazeez337 syedazeez337 force-pushed the fix/nodepool-metrics-and-dashboard-defaults branch from cb1bc6a to 4dc1d42 Compare January 1, 2026 05:22
Copy link
Copy Markdown
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

I wonder whether this is an efficient solution given we are doing the listing here just for the sake of the metric. But it seems the same kind of workaround we alreadyuse for connectors, so maybe we can stick with it ... 🤔

@scholzj
Copy link
Copy Markdown
Member

scholzj commented Jan 2, 2026

It seems some tests failed on Azure. Let's see if they fail on GitHub Actions as well. But my guess is that they are related to this change:

[ERROR] Errors: 
[ERROR] io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext)
[ERROR]   Run 1: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 2: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 3: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 4: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 5: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 6: KafkaAssemblyOperatorWithKRaftTest.testReconcileAllNamespaces(VertxTestContext) » Timeout testReconcileAllNamespaces(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[INFO] 
[ERROR] io.strimzi.operator.cluster.operator.assembly.KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext)
[ERROR]   Run 1: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 2: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 3: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 4: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 5: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[ERROR]   Run 6: KafkaAssemblyOperatorWithKRaftTest.testReconcileMultipleKafkaInOneNamespace(VertxTestContext) » Timeout testReconcileMultipleKafkaInOneNamespace(io.vertx.junit5.VertxTestContext) timed out after 5 seconds
[INFO] 

I think you likely need to mock additional methods to make them pass.

@scholzj scholzj added this to the 0.50.0 milestone Jan 2, 2026
@syedazeez337 syedazeez337 force-pushed the fix/nodepool-metrics-and-dashboard-defaults branch 2 times, most recently from dbe4540 to db4f82c Compare January 7, 2026 10:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.81%. Comparing base (242169c) to head (39a6648).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...uster/operator/assembly/KafkaAssemblyOperator.java 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12281      +/-   ##
============================================
- Coverage     74.82%   74.81%   -0.01%     
- Complexity     6633     6639       +6     
============================================
  Files           376      376              
  Lines         25351    25370      +19     
  Branches       3402     3402              
============================================
+ Hits          18969    18981      +12     
- Misses         4995     5000       +5     
- Partials       1387     1389       +2     
Files with missing lines Coverage Δ
...r/assembly/KafkaAssemblyOperatorMetricsHolder.java 100.00% <100.00%> (ø)
...uster/operator/assembly/KafkaAssemblyOperator.java 83.45% <75.00%> (-0.40%) ⬇️

... and 91 files with indirect coverage changes

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

@scholzj
Copy link
Copy Markdown
Member

scholzj commented Jan 7, 2026

/gha run pipeline=regression

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026

⏳ System test verification started: link

The following 6 job(s) will be executed:

  • regression-brokers-and-security-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operators-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-operands-amd64 (oracle-vm-8cpu-32gb-x86-64)
  • regression-brokers-and-security-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operators-arm64 (oracle-vm-8cpu-32gb-arm64)
  • regression-operands-arm64 (oracle-vm-8cpu-32gb-arm64)

Tests will start after successful build completion.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 7, 2026

🎉 System test verification passed: link

Copy link
Copy Markdown
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

@syedazeez337 The code for the Node pool metrics looks good to me. But on the community call on Thursday during the issue triaged, we discussed the #12139 issue and the decision was that the defaults should be verywhere N/A rather than 0. Maybe the easiest way would be to remove the dashboard change from this PR, get this merged and the #12139 can be handled in a separate PR? Thanks.

- Add nodePoolResourceCounter to KafkaAssemblyOperatorMetricsHolder
- Override reconcileThese() in KafkaAssemblyOperator to count NodePools
- Add unit tests for new metrics methods
- Add mocks for nodePoolOperator.listAsync() in KafkaAssemblyOperatorWithKRaftTest

Fixes strimzi#12138

Signed-off-by: Azeez Syed <syedazeez337@gmail.com>
@syedazeez337 syedazeez337 force-pushed the fix/nodepool-metrics-and-dashboard-defaults branch from db4f82c to 39a6648 Compare January 11, 2026 05:54
Copy link
Copy Markdown
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR.

@scholzj scholzj requested a review from ppatierno January 11, 2026 14:23
@syedazeez337
Copy link
Copy Markdown
Contributor Author

@scholzj Hi, if I may ask, is anyone working on the other pr or can I take that as well?

@scholzj
Copy link
Copy Markdown
Member

scholzj commented Jan 11, 2026

@syedazeez337 You mean the #12139? Sure, you can work on it.

Copy link
Copy Markdown
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@scholzj scholzj merged commit d4f8cae into strimzi:main Jan 12, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The KafkaNodePool CR count metric is missing

3 participants