Skip to content

Feature/public controller metrics#731

Open
Spground wants to merge 3 commits intoalibaba:mainfrom
Spground:feature/public-controller-metrics
Open

Feature/public controller metrics#731
Spground wants to merge 3 commits intoalibaba:mainfrom
Spground:feature/public-controller-metrics

Conversation

@Spground
Copy link
Copy Markdown
Collaborator

@Spground Spground commented Apr 16, 2026

Summary

  • What is changing and why?
  1. Add breakdown latency log and metrics in core schedule
  2. Update logger to support nano sec

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf761255be

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

start0 := time.Now()
err := r.Allocator.SyncSandboxAllocation(ctx, info.Sandbox, info.Pods)
latencyMs0 := time.Since(start0).Milliseconds()
allocatorSyncSingleAllocResultDurationSummary.WithLabelValues(info.Sandbox.Namespace, info.Sandbox.Spec.PoolRef, info.Sandbox.Name, strconv.FormatBool(err == nil)).Observe(float64(latencyMs0))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drop sandbox_name from sync latency labels

This metric uses info.Sandbox.Name as a label value, which creates a distinct Summary time series for every sandbox ever seen. Since the controller never deletes label values, a cluster with normal sandbox churn will continuously grow in-memory metric state and scrape payload size over process lifetime, which can become a reliability issue in production. Keep this metric at bounded cardinality (e.g., namespace/pool/success only) and use logs for per-sandbox detail.

Useful? React with 👍 / 👎.

return zap.New(zap.UseFlagOptions(&opts.ZapOptions))
return zap.New(
zap.UseFlagOptions(&opts.ZapOptions),
zap.Encoder(zapcore.NewJSONEncoder(encoderConfig)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep zap CLI encoder settings effective

Hard-coding a JSON encoder here overrides encoder-related options parsed from opts.BindFlags, so operators can no longer rely on documented flags like --zap-encoder (and related time-encoding choices) to control log format. This is a behavior regression from the previous implementation, where zap.UseFlagOptions determined the encoder.

Useful? React with 👍 / 👎.

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.

1 participant