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

Print NginxConfig in JSON format for debug and trace levels #210

Merged
merged 4 commits into from
Mar 1, 2023

Conversation

dareste
Copy link
Contributor

@dareste dareste commented Feb 20, 2023

Proposed changes

This PR changes the log.traceF and log.debugF function arguments in those cases where we log the NginxConfig protobuf message. Instead of the raw message (which is harder to parse and read when doing troubleshooting), the JSON version of the object is now logged.

Closes #209

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md)

@netlify
Copy link

netlify bot commented Feb 20, 2023

Deploy Preview for agent-public-docs ready!

Name Link
🔨 Latest commit 123a91b
🔍 Latest deploy log https://app.netlify.com/sites/agent-public-docs/deploys/63fdd5cdbf4afa000815e0a2
😎 Deploy Preview https://deploy-preview-210--agent-public-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the chore Pull requests for routine tasks label Feb 20, 2023
src/core/nginx.go Outdated Show resolved Hide resolved
src/plugins/nginx.go Outdated Show resolved Hide resolved
@dhurley
Copy link
Collaborator

dhurley commented Feb 20, 2023

Can you run make deps as well?

@dareste
Copy link
Contributor Author

dareste commented Feb 21, 2023

@dhurley make deps is failing in my fork:

fatal: No names found, cannot describe anything.
cd sdk && go mod tidy && go mod vendor && make generate && go mod tidy && go mod vendor
go: finding module for package github.com/nginx/agent/sdk/v2/proto/events
go: finding module for package github.com/nginx/agent/sdk/v2/proto
github.com/nginx/agent/sdk/v2 imports
github.com/nginx/agent/sdk/v2/proto: no matching versions for query "latest"
github.com/nginx/agent/sdk/v2/client imports
github.com/nginx/agent/sdk/v2/proto/events: no matching versions for query "latest"
make: *** [deps] Error 1

@dhurley
Copy link
Collaborator

dhurley commented Feb 21, 2023

Hi @dareste, I think there are 2 things you need to do before running make deps.

  1. Install protoc https://grpc.io/docs/protoc-installation/
  2. Run make install-tools

These 2 things only need to be done the first time you start using the agent.
I will be creating another PR to update the README with these instructions.

Let me know if this resolves your issue.

src/core/nginx.go Outdated Show resolved Hide resolved
@Dean-Coakley
Copy link
Contributor

LGTM once vendor dir is updated: #210 (comment)

@oliveromahony
Copy link
Contributor

make deps looks outdated, I'll do a separate PR for that

@oliveromahony oliveromahony merged commit 960eefb into nginx:main Mar 1, 2023
@dareste dareste deleted the dareste-json-nginxconfig branch March 14, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Print a JSON representation of the NginxConfig proto message in debug logs
4 participants