Skip to content

fix(cubelet): register metric plugin to enable /v1/metrics/scheduler endpoint#301

Merged
kinwin-ustc merged 1 commit into
TencentCloud:masterfrom
chenggui53:fix/register-metric-plugin
May 19, 2026
Merged

fix(cubelet): register metric plugin to enable /v1/metrics/scheduler endpoint#301
kinwin-ustc merged 1 commit into
TencentCloud:masterfrom
chenggui53:fix/register-metric-plugin

Conversation

@chenggui53
Copy link
Copy Markdown
Contributor

@chenggui53 chenggui53 commented May 18, 2026

The metric plugin was missing from builtins.go, so its init() never ran and the /v1/metrics/scheduler endpoint returned 404. Adding the blank import so the plugin registers with containerd's plugin system.

@chenggui53 chenggui53 requested a review from fslongjin as a code owner May 18, 2026 12:56
@chenggui53 chenggui53 changed the title fix(cubelet): register metric plugin to enable /v1/metrics/scheduler fix(cubelet): register metric plugin to enable /v1/metrics/scheduler endpoint May 18, 2026
@chenggui53 chenggui53 force-pushed the fix/register-metric-plugin branch from 2c54d3d to db94e3f Compare May 18, 2026 12:57
…endpoint

The metric plugin was missing from builtins.go, so its init() never
ran and the /v1/metrics/scheduler endpoint returned 404. Adding the
blank import so the plugin registers with containerd's plugin system.

Signed-off-by: chenggui53 <chenggui53@gmail.com>
@chenggui53 chenggui53 force-pushed the fix/register-metric-plugin branch from db94e3f to 28ba109 Compare May 18, 2026 12:59
@kinwin-ustc
Copy link
Copy Markdown
Collaborator

/cubebot review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Claude finished @kinwin-ustc's task in 44s —— View job


Code Review

Summary

This PR adds a blank import for the metric plugin (Cubelet/plugins/cube/internals/metric) in builtins.go. Without this import, the plugin's init() function never executes, and containerd's plugin system never registers the metric service, causing the /v1/metrics/scheduler endpoint to return 404.

What was checked

  • Diff correctness: The added import is in alphabetical order within the cube/internals/* import block — it's correctly placed between cubes and netfile.
  • Plugin registration: The metric plugin (plugin.go line 44) uses registry.Register() in its init(), so a blank import is the correct and sufficient mechanism to trigger registration.
  • Pattern consistency: This follows the same convention as all other plugins in the file (e.g., sandbox, cgroup, createid, images, etc.).

Finding

LGTM — the change is correct and minimal. The single-line addition is exactly what's needed. No issues found.

Minor note (pre-existing, not related to this PR)

There's a duplicate import of cube/multimeta at lines 69 and 74. This is unrelated to the fix here, but worth cleaning up in a follow-up since duplicate imports are a dead code smell.


  • Read the diff
  • Verified the metric plugin uses init() + registry.Register()
  • Confirmed alphabetical placement within import block
  • Reviewed for correctness and completeness

@kinwin-ustc kinwin-ustc merged commit 6874acc into TencentCloud:master May 19, 2026
7 of 8 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.

2 participants