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

Refactor: Modify logger implementation and log level #3103

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

aimuz
Copy link
Collaborator

@aimuz aimuz commented Apr 14, 2023

admission webhook "validations.agones.dev" denied the request: FleetAutoscaler is invalid
I encountered this error in my use and did not return any details to me, I would like to see him in the agones log

Signed-off-by: aimuz mr.imuz@gmail.com

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 cleanup

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes #

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 03222830-246a-4c20-a8bc-13cc1806b076

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/3103/head:pr_3103 && git checkout pr_3103
  • helm install agones ./install/helm/agones --namespace agones-system --agones.image.release=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.32.0-b575ae1-amd64

@markmandel
Copy link
Member

admission webhook "validations.agones.dev" denied the request: FleetAutoscaler is invalid
I encountered this error in my use and did not return any details to me, I would like to see him in the agones log

I'm not sure I follow what extra information this provides you as the end user. Can you expand on why you want this change in the Agones controller logs?

@aimuz
Copy link
Collaborator Author

aimuz commented Apr 19, 2023

Thanks for the reply, I am trying to integrate agones with our internal platform, during the integration I created FleetAutoscaler and Fleet using agones' client-go, via err.Error() I get "Invalid FleetAutoscaler " error, at this point I don't know exactly what field is causing the error.

https://github.com/googleforgames/agones/blob/main/pkg/fleets/controller.go#L215

I would like to add a log where I can look at the agones log and get detailed information, just like there are logs for Fleet creation or update failure.

I'm not sure if it's agones or client-go, in other types like Deployment, or Ingress during creation or update failures, I can get the details via err.Error(). But here I did not go deeper into the investigation at the moment.

@markmandel
Copy link
Member

I'm not sure if it's agones or client-go, in other types like Deployment, or Ingress during creation or update failures, I can get the details via err.Error(). But here I did not go deeper into the investigation at the moment.

It sounds a lot like we should improve the error message -- we pass up the StatusDetails with a list of causes -- so in theory it should all be there.

I'll note in out controllers we Debug the admissionReview, but we don't Warn it -- that could get a little verbose.

@aimuz
Copy link
Collaborator Author

aimuz commented Apr 22, 2023

loggerForFleet(fleet, ext.baseLogger).WithField("review", review).Warn("Invalid Fleet")

Does this section also need to be changed to Debug?

@markmandel
Copy link
Member

Yeah - that;s inline with what we do elsewhere.

@aimuz
Copy link
Collaborator Author

aimuz commented Apr 22, 2023

Please review, I changed it to Debug

@aimuz aimuz changed the title fix: Adding Log Output to FleetAutoscaler Refactor: Modify logger implementation and log level Apr 22, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: e6ee3872-679b-4400-8dd4-717afc14ec31

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: fdb37dee-c65e-41cc-9688-4cb7875759ff

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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3cbf1d2f-2475-4acf-82a5-eeaa6f2b83e5

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/3103/head:pr_3103 && git checkout pr_3103
  • helm install agones ./install/helm/agones --namespace agones-system --agones.image.release=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.32.0-b249d18-amd64

@zmerlynn zmerlynn self-assigned this Apr 25, 2023
Copy link
Collaborator

@zmerlynn zmerlynn left a comment

Choose a reason for hiding this comment

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

LGTM - thanks @aimuz

@google-oss-prow google-oss-prow bot added the lgtm label Apr 25, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aimuz, zmerlynn
Once this PR has been reviewed and has the lgtm label, please assign markmandel for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 7484fd0f-2c50-4fd0-9f9f-5a2d6de8644a

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

@aimuz
Copy link
Collaborator Author

aimuz commented Apr 25, 2023

I'm surprised that the build error seems to occur frequently lately, but after re-pushing it works again

@google-oss-prow google-oss-prow bot removed the lgtm label Apr 25, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 81bbba9a-b9e1-4e76-9625-3ce5ae9ae110

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

This commit refactors the `loggerForFleetAutoscalerKey` and `loggerForFleetAutoscaler`
functions to support more flexible input types by adding a new parameter `logger *logrus.Entry`.

In addition, it modifies the logging level of the `creationValidationHandler`
function from Warn to Debug, improving code readability.

Changes Made:
- Modified `loggerForFleetAutoscalerKey` and `loggerForFleetAutoscaler` to support more flexible input types
- Adjusted the logging level of the `creationValidationHandler`

Signed-off-by: aimuz <mr.imuz@gmail.com>
@aimuz aimuz requested a review from zmerlynn April 26, 2023 03:16
@aimuz
Copy link
Collaborator Author

aimuz commented Apr 26, 2023

rebase

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 952810d3-7cee-4e95-b23c-a31e7743082b

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/3103/head:pr_3103 && git checkout pr_3103
  • helm install agones ./install/helm/agones --namespace agones-system --agones.image.release=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.32.0-f267a5a-amd64

@gongmax gongmax merged commit 5ac0344 into googleforgames:main Apr 26, 2023
@Kalaiselvi84 Kalaiselvi84 added the kind/cleanup Refactoring code, fixing up documentation, etc label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Refactoring code, fixing up documentation, etc size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants