Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric for number of reserved replicas in a fleet #2609

Closed
roberthbailey opened this issue Jun 4, 2022 · 2 comments · Fixed by #2610
Closed

Add metric for number of reserved replicas in a fleet #2609

roberthbailey opened this issue Jun 4, 2022 · 2 comments · Fixed by #2610
Labels
help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones
Milestone

Comments

@roberthbailey
Copy link
Member

Is your feature request related to a problem? Please describe.
The current metrics for fleets include total game servers, allocated game servers, ready game servers, and desired game servers. Since the reserved game server state was added in #766 we haven't updated the metrics to count game servers in this state.

Describe the solution you'd like
Update the recordFleetReplicas function to include reserved game servers:

func (c *Controller) recordFleetReplicas(fleetName, fleetNamespace string, total, allocated, ready, desired int32) {
ctx, _ := tag.New(context.Background(), tag.Upsert(keyName, fleetName), tag.Upsert(keyNamespace, fleetNamespace))
recordWithTags(ctx, []tag.Mutator{tag.Upsert(keyType, "total")},
fleetsReplicasCountStats.M(int64(total)))
recordWithTags(ctx, []tag.Mutator{tag.Upsert(keyType, "allocated")},
fleetsReplicasCountStats.M(int64(allocated)))
recordWithTags(ctx, []tag.Mutator{tag.Upsert(keyType, "ready")},
fleetsReplicasCountStats.M(int64(ready)))
recordWithTags(ctx, []tag.Mutator{tag.Upsert(keyType, "desired")},
fleetsReplicasCountStats.M(int64(desired)))
}

Describe alternatives you've considered
None. We should totally do this.

Additional context
n/a

@roberthbailey roberthbailey added kind/feature New features for Agones help wanted We would love help on these issues. Please come help us! labels Jun 4, 2022
@govargo
Copy link
Contributor

govargo commented Jun 4, 2022

I'd like to try this issue.
I'll send the PR fot this.

@roberthbailey
Copy link
Member Author

Awesome!

markmandel added a commit to markmandel/agones that referenced this issue Jun 6, 2022
Noticed there weren't docs for googleforgames#2609, so here there are!
roberthbailey pushed a commit that referenced this issue Jun 6, 2022
Noticed there weren't docs for #2609, so here there are!
@SaitejaTamma SaitejaTamma added this to the 1.24.0 milestone Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants