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 logging to NGINX API http requests #605

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

dhurley
Copy link
Collaborator

@dhurley dhurley commented Mar 19, 2024

Proposed changes

  • Add logging to NGINX API http requests
  • Increase http client timeout

Checklist

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

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • 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
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@dhurley dhurley self-assigned this Mar 19, 2024
@github-actions github-actions bot added chore Pull requests for routine tasks dependencies labels Mar 19, 2024
Copy link

netlify bot commented Mar 19, 2024

Deploy Preview for agent-public-docs canceled.

Name Link
🔨 Latest commit 10a6920
🔍 Latest deploy log https://app.netlify.com/sites/agent-public-docs/deploys/65f9c43dc60b290008a28cc6

return false
}

// Expecting API to return the api versions in an array of positive integers
// subset example: [ ... 6,7,8,9 ...]
var responseBody []int
err = json.Unmarshal(bodyBytes, &responseBody)
if err != nil {
log.Debugf("Unable to unmarshal NGINX Plus API response body: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a warning?

return false
}

bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
log.Debugf("Unable to read Stub Status API response body: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a warning?

resp, err := client.Get(statusAPI)
if err != nil {
log.Debugf("Unable to create client for Stub Status API request: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a warning?

@dhurley dhurley merged commit 2b2d69b into main Mar 22, 2024
29 checks passed
@dhurley dhurley deleted the add-logging-to-nginx-api-http-requests branch March 22, 2024 10:29
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 dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants