Add performance metrics to controllers#499
Merged
dgkanatsios merged 4 commits intomainfrom Mar 23, 2026
Merged
Conversation
…lers Add Prometheus histogram metrics to track: - GameServer controller reconciliation duration - GameServerBuild controller reconciliation duration - Individual GameServer creation duration - Individual GameServer deletion duration Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> Agent-Logs-Url: https://github.com/PlayFab/thundernetes/sessions/7e3c4e94-d118-43dd-9d35-d93f02f2f5c5
Copilot
AI
changed the title
[WIP] Add performance metrics to controllers
Add performance metrics to controllers
Mar 21, 2026
Collaborator
|
@copilot the reconciliation metrics seem OK, but the creation/deletion metrics should be close to zero, as the call to K8s API server should be really fast. What do you think? |
Individual K8s API calls for GameServer creation/deletion are very fast, so per-operation duration metrics would be close to zero and not useful. The reconciliation duration histograms already capture the full picture including all batch creation/deletion time. Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> Agent-Logs-Url: https://github.com/PlayFab/thundernetes/sessions/6c0ae221-390f-45ce-a2ee-3a4d1cfdb8e8
Contributor
Author
You're right — individual K8s API calls for creation/deletion are very fast, so those per-operation duration metrics would be near zero and not useful. Removed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Controllers lacked timing metrics for reconciliation operations.
New Prometheus histograms
thundernetes_gameserver_reconcile_duration_seconds— GameServer controller reconcile latencythundernetes_gameserverbuild_reconcile_duration_seconds(BuildName) — GameServerBuild controller reconcile latencyAll use
prometheus.DefBucketsand register viapromauto.With(metrics.Registry), consistent with existing metrics.Instrumentation points
GameServerReconciler.Reconcile—deferat method entryGameServerBuildReconciler.Reconcile—deferafter fetching the GSB (soBuildNamelabel is available)Per-operation creation/deletion duration metrics were intentionally omitted since individual K8s API calls are very fast and those values would be close to zero. The reconciliation duration histograms already capture the full picture including all batch creation/deletion time.
Original prompt
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.