Skip to content

[Feature Proposal] - Total Allocations Tracking #4452

@nrwiersma

Description

@nrwiersma

Is your feature request related to a problem? Please describe.
At no point does Agones track or expose the number of allocations (GameServers moving into Allocated state). This however is an extremely useful metric in general, but also specifically for autoscaling.

Describe the solution you'd like
Add TotalAllocations to the FleetStatus, which is a uint64 counter of the total number of allocations observed over time. This should not update the Fleet for every allocation observed, but rather rate limit changes to the Fleet for this counter to 1s. A prom metric should also be exposed with this data.

The TotalAllocations field should be provided in the FleetAutoscaleRequest to webhooks and WASM.

This allows users to reason about the number of allocations on a fleet and react to this data in a custom autoscaler, which should allow for better buffer size optimisation.

An example of the new FleetStatus:

type FleetStatus struct {
	Replicas int32 `json:"replicas"`
	ReadyReplicas int32 `json:"readyReplicas"`
	ReservedReplicas int32 `json:"reservedReplicas"`
	AllocatedReplicas int32 `json:"allocatedReplicas"`
	TotalAllocations uint64 `json:"totalAllocations"`
	Players *AggregatedPlayerStatus `json:"players,omitempty"`
	Counters map[string]AggregatedCounterStatus `json:"counters,omitempty"`
	Lists map[string]AggregatedListStatus `json:"lists,omitempty"`
}

Describe alternatives you've considered
It is possible to do this outside of Agones in a custom controller or webhook, and then inject the data where needed.

Additional context
Add any other context or screenshots about the feature request here.

Link to the Agones Feature Proposal (if any)
The link to the AFP PR.

Discussion Link (if any)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions