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

[Performance] - Added a new metric inside the allocator to track the success retry rate inside the retry loop #3927

Merged
merged 27 commits into from
Aug 22, 2024

Conversation

vicentefb
Copy link
Collaborator

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes #

Special notes for your reviewer:

@vicentefb vicentefb marked this pull request as draft July 30, 2024 00:06
@github-actions github-actions bot added kind/feature New features for Agones size/S labels Jul 30, 2024
@vicentefb
Copy link
Collaborator Author

image

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 0f7a5893-6cde-4df1-b197-39ec5149f5d0

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: fc6bb5e6-26d5-4326-905f-6bca3ccab458

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: e2c4011c-aa43-4073-89e1-a3d782d350e9

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-63b606b

pkg/gameserverallocations/metrics.go Outdated Show resolved Hide resolved
pkg/gameserverallocations/metrics.go Outdated Show resolved Hide resolved
pkg/gameserverallocations/metrics.go Outdated Show resolved Hide resolved
@@ -82,8 +101,8 @@ func (r *metrics) setStatus(status string) {
}

// setError set the latency status tag as error.
func (r *metrics) setError() {
r.mutate(tag.Update(keyStatus, "error"))
func (r *metrics) setError(errorType string) {
Copy link
Member

Choose a reason for hiding this comment

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

This whole function seems... odd to me.

Any reason we aren't using stats.RecordWithTags() everywhere instead?

We have some nice helpers too:

func recordWithTags(ctx context.Context, mutators []tag.Mutator, ms ...stats.Measurement) {
if err := stats.RecordWithTags(ctx, mutators, ms...); err != nil {
logger.WithError(err).Warn("error while recoding stats")
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mmmm i'm not entirely sure why we aren't using stats.RecordWithTags(). There's only one other metric in this file which is the latency one and it uses stats.Record(r.ctx, gameServerAllocationsLatency.M(time.Since(r.start).Seconds())) directly. I could update this file and change it in this PR to use stats.RecordWithTags()

Copy link
Member

Choose a reason for hiding this comment

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

SGTM

Copy link
Collaborator Author

@vicentefb vicentefb Aug 6, 2024

Choose a reason for hiding this comment

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

Ohhh i think i see why, it first records the metrics and then it does a lot of manipulation with the tags for example: latency.setRequest(gsa) mutates tags same case with latency.setResponse(out) I can probably merge latency.record() and latency.setRequest(gsa) but not sure about latency.setResponse(out) since that happens later in the function and the code can return before that. Wdyt ?

pkg/gameserverallocations/allocator.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added the size/M label Aug 6, 2024
@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: b6259f67-d6b3-45d7-b6e6-1e1e21a141fa

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: f9d573da-bd4a-4b60-b785-682b9f7db633

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: c6e0a254-23ce-431a-85f7-754694c0b0d6

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 85d95b8d-c99f-489e-9d9c-54f4bbc171a7

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 639e5381-e7e0-41b8-9d92-cbd2403b32f3

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: c7506251-d532-4760-a93e-d1ac4453dc18

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: e9f2495f-b9f1-404a-9c8a-7a9d9651c17b

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-ee53588

@vicentefb vicentefb marked this pull request as ready for review August 14, 2024 16:33
@vicentefb vicentefb requested a review from gongmax August 19, 2024 22:34
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: a58b657d-9dce-4dcf-8272-32346d40012a

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-199be7d

pkg/gameserversets/controller.go Outdated Show resolved Hide resolved
pkg/gameserversets/metrics.go Outdated Show resolved Hide resolved
pkg/gameserversets/metrics.go Outdated Show resolved Hide resolved
pkg/gameserverallocations/metrics.go Outdated Show resolved Hide resolved
pkg/gameserverallocations/metrics.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: cafa4a1f-80fc-4c9c-a894-6609a0f71e50

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-26953dd

pkg/gameserverallocations/allocator.go Outdated Show resolved Hide resolved
site/content/en/docs/Guides/metrics.md Outdated Show resolved Hide resolved
pkg/gameserversets/metrics.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 4c0e4600-5979-4e88-8de6-be52ec42a260

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-0315b59

@gongmax gongmax enabled auto-merge (squash) August 21, 2024 23:32
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 42c40261-f22c-4900-a08f-2fdf11e231ee

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3927/head:pr_3927 && git checkout pr_3927
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-76bd6d4

@gongmax gongmax merged commit 1a5dc06 into googleforgames:main Aug 22, 2024
4 checks passed
spiceratops added a commit to spiceratops/k8s-gitops that referenced this pull request Aug 30, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [agones](https://agones.dev)
([source](https://redirect.github.com/googleforgames/agones)) | minor |
`1.42.0` -> `1.43.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>googleforgames/agones (agones)</summary>

###
[`v1.43.0`](https://redirect.github.com/googleforgames/agones/releases/tag/v1.43.0)

[Compare
Source](https://redirect.github.com/googleforgames/agones/compare/v1.42.0...v1.43.0)

This is the 1.43.0 release of Agones.

In this release, we updated the supported Kubernetes version, added a
new scheduled autoscaler, as well as Unity support for Counters and
Lists..

-   **Kubernetes 1.30 Support**
With this release, the Kubernetes support matrix for Agones is now 1.28,
1.29 and 1.30.

-   **Alpha support for ScheduledAutoscaler**
This provides the ability to have Fleet autoscaler scheduling with the
feature flag `ScheduledAutoscaler`, to allow you to schedule what level
of autoscaling you would like on a schedule or between dates, giving you
more control over your autoscaling needs.

-   **Unity SDK: Counters and Lists**
We now have support for `GameServer` [Counters and
Lists](https://agones.dev/site/docs/guides/counters-and-lists/) with our
Unity SDK!

-   **New Helm Installation Configuration Options**
    Two new installation options!

We made the parameters that control how fast we scale up and down
`GameServers` configurable, so you can see how fast your Kubernetes
control plane really is when spinning up lots of `GameServer` instances.

We also have new Helm configuration options that allow the use of the
host network for the Agones controller and extensions for AWS EKS when
using Cilium.

-   **Beta support for Passthrough PortPolicy on GKE Autopilot**
We’ve graduated Passthrough Port Policy support from Alpha to Beta on
GKE Autopilot, which you can now enable using the feature flag
`AutopilotPassthroughPort`.

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Breaking changes

- Revert "Update Supported Kubernetes to 1.28, 1.29, 1.30
([#&#8203;3933](https://redirect.github.com/googleforgames/agones/issues/3933))"
by [@&#8203;gongmax](https://redirect.github.com/gongmax) in
[googleforgames/agones#3952

##### Implemented enhancements

- Add Option to Use Host Network and Configure Ports by
[@&#8203;Orza](https://redirect.github.com/Orza) in
[googleforgames/agones#3895
- Graduate Passthrough Port Policy to Beta on Autopilot by
[@&#8203;vicentefb](https://redirect.github.com/vicentefb) in
[googleforgames/agones#3916
- Agones Unity SDK development setup instructions + Agones Unity SDK
Ready test by [@&#8203;aallbrig](https://redirect.github.com/aallbrig)
in
[googleforgames/agones#3887
- feat: Add API Changes and Validation for FleetAutoscaler
Schedule/Chain Policy by
[@&#8203;indexjoseph](https://redirect.github.com/indexjoseph) in
[googleforgames/agones#3893
- feat: Adds autoscaling logic for new Chain and Schedule policies by
[@&#8203;indexjoseph](https://redirect.github.com/indexjoseph) in
[googleforgames/agones#3929
- Adds basic framework for the in place Agones upgrades test controller
by [@&#8203;igooch](https://redirect.github.com/igooch) in
[googleforgames/agones#3956
- \[Performance] - Added a new metric inside the allocator to track the
success retry rate inside the retry loop by
[@&#8203;vicentefb](https://redirect.github.com/vicentefb) in
[googleforgames/agones#3927
- Make the parameters that limits the number of GameServers to add
configurable by
[@&#8203;vicentefb](https://redirect.github.com/vicentefb) in
[googleforgames/agones#3950
- feat: Adds e2e tests for chain/schedule policy and bump
ScheduledAutoscaler to Alpha by
[@&#8203;indexjoseph](https://redirect.github.com/indexjoseph) in
[googleforgames/agones#3946
- Implement CountsAndLists for Unity SDK + Tests by
[@&#8203;ZeroParticle](https://redirect.github.com/ZeroParticle) in
[googleforgames/agones#3883

##### Fixed bugs

- Resolves `make site-server` issue
[#&#8203;3885](https://redirect.github.com/googleforgames/agones/issues/3885)
by [@&#8203;aallbrig](https://redirect.github.com/aallbrig) in
[googleforgames/agones#3914

##### Other

- Preparation for Release v1.43.0 by
[@&#8203;kamaljeeti](https://redirect.github.com/kamaljeeti) in
[googleforgames/agones#3910
- Introduce external resource(s) on multiplayer game programming to docs
by [@&#8203;aallbrig](https://redirect.github.com/aallbrig) in
[googleforgames/agones#3884
- Added line of code to update failure count details inside runscenario
by [@&#8203;vicentefb](https://redirect.github.com/vicentefb) in
[googleforgames/agones#3915
- updated golang upgrade template by
[@&#8203;ashutosji](https://redirect.github.com/ashutosji) in
[googleforgames/agones#3902
- Changes for GitHub/Cloud Build app integration by
[@&#8203;zmerlynn](https://redirect.github.com/zmerlynn) in
[googleforgames/agones#3918
- Meta: Contributor role by
[@&#8203;markmandel](https://redirect.github.com/markmandel) in
[googleforgames/agones#3922
- Fix allocator metrics endpoint by
[@&#8203;vicentefb](https://redirect.github.com/vicentefb) in
[googleforgames/agones#3921
- Meta: Contributor => Collaborator by
[@&#8203;markmandel](https://redirect.github.com/markmandel) in
[googleforgames/agones#3928
- Rewrite agones-bot, commit to Agones repo by
[@&#8203;zmerlynn](https://redirect.github.com/zmerlynn) in
[googleforgames/agones#3923
- Small cleanup of incorrect comment in features.go file by
[@&#8203;igooch](https://redirect.github.com/igooch) in
[googleforgames/agones#3944
- Update Supported Kubernetes to 1.28, 1.29, 1.30 by
[@&#8203;ashutosji](https://redirect.github.com/ashutosji) in
[googleforgames/agones#3933
- remove ctx within the condition func by
[@&#8203;peterzhongyi](https://redirect.github.com/peterzhongyi) in
[googleforgames/agones#3959
- Reapply "Update Supported Kubernetes to 1.28, 1.29, 1.30
([#&#8203;3933](https://redirect.github.com/googleforgames/agones/issues/3933))"
([#&#8203;3](https://redirect.github.com/googleforgames/agones/issues/3)…
by [@&#8203;gongmax](https://redirect.github.com/gongmax) in
[googleforgames/agones#3961
- change kubernetes API version to fix broken CI by
[@&#8203;peterzhongyi](https://redirect.github.com/peterzhongyi) in
[googleforgames/agones#3962
- docs(godot): add Agones x Godot third party example by
[@&#8203;andresromerodev](https://redirect.github.com/andresromerodev)
in
[googleforgames/agones#3938
- Link Unity Netcode for Gameobjects example in documentation by
[@&#8203;mbychkowski](https://redirect.github.com/mbychkowski) in
[googleforgames/agones#3937
- Docs: Use k8s-api-version for links by
[@&#8203;markmandel](https://redirect.github.com/markmandel) in
[googleforgames/agones#3963

#### New Contributors

- [@&#8203;Orza](https://redirect.github.com/Orza) made their first
contribution in
[googleforgames/agones#3895

**Full Changelog**:
googleforgames/agones@v1.42.0...v1.43.0

Images available with this release:

-
[us-docker.pkg.dev/agones-images/release/agones-controller:1.43.0](https://us-docker.pkg.dev/agones-images/release/agones-controller:1.43.0)
-
[us-docker.pkg.dev/agones-images/release/agones-sdk:1.43.0](https://us-docker.pkg.dev/agones-images/release/agones-sdk:1.43.0)
-
[us-docker.pkg.dev/agones-images/release/agones-ping:1.43.0](https://us-docker.pkg.dev/agones-images/release/agones-ping:1.43.0)
-
[us-docker.pkg.dev/agones-images/release/agones-allocator:1.43.0](https://us-docker.pkg.dev/agones-images/release/agones-allocator:1.43.0)
-
[us-docker.pkg.dev/agones-images/examples/allocation-endpoint-proxy:0.9](https://us-docker.pkg.dev/agones-images/examples/allocation-endpoint-proxy:0.9)
-
[us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.14](https://us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.14)
-
[us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.18](https://us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.18)
-
[us-docker.pkg.dev/agones-images/examples/crd-client:0.17](https://us-docker.pkg.dev/agones-images/examples/crd-client:0.17)
-
[us-docker.pkg.dev/agones-images/examples/nodejs-simple-server:0.10](https://us-docker.pkg.dev/agones-images/examples/nodejs-simple-server:0.10)
-
[us-docker.pkg.dev/agones-images/examples/rust-simple-server:0.13](https://us-docker.pkg.dev/agones-images/examples/rust-simple-server:0.13)
-
[us-docker.pkg.dev/agones-images/examples/simple-game-server:0.34](https://us-docker.pkg.dev/agones-images/examples/simple-game-server:0.34)
-
[us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.14](https://us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.14)
-
[us-docker.pkg.dev/agones-images/examples/unity-simple-server:0.3](https://us-docker.pkg.dev/agones-images/examples/unity-simple-server:0.3)
-
[us-docker.pkg.dev/agones-images/examples/xonotic-example:2.0](https://us-docker.pkg.dev/agones-images/examples/xonotic-example:2.0)

Helm chart available with this release:

- <a href="https://agones.dev/chart/stable/agones-1.43.0.tgz"
data-proofer-ignore>
    <code>helm install agones agones/agones --version 1.43.0</code></a>

> Make sure to add our stable helm repository using `helm repo add
agones https://agones.dev/chart/stable`

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ny4xIiwidXBkYXRlZEluVmVyIjoiMzguNTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUvaGVsbSIsInR5cGUvbWlub3IiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones size/M size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants