Skip to content

Add source to logs in Debug Mode & Clean up function names #1104

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

Merged
merged 12 commits into from
Jun 10, 2025

Conversation

aphralG
Copy link
Contributor

@aphralG aphralG commented Jun 3, 2025

Proposed changes

  • Add source to logs in debug mode
  • Added extra logging to processing of messages
  • Remove Get from as many function names as possible to follow Go naming convention

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

@aphralG aphralG self-assigned this Jun 3, 2025
@aphralG aphralG requested a review from a team as a code owner June 3, 2025 13:19
@github-actions github-actions bot added the chore Pull requests for routine tasks label Jun 3, 2025
@@ -398,6 +400,7 @@ func (oc *Collector) checkForNewReceivers(nginxConfigContext *model.NginxConfigC
nginxReceiverFound, reloadCollector := oc.updateExistingNginxPlusReceiver(nginxConfigContext)

if !nginxReceiverFound && nginxConfigContext.PlusAPI.URL != "" {
slog.Debug("Adding new Nginx Plus receiver", "url", nginxConfigContext.PlusAPI.URL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
slog.Debug("Adding new Nginx Plus receiver", "url", nginxConfigContext.PlusAPI.URL)
slog.Debug("Adding new NGINX Plus receiver", "url", nginxConfigContext.PlusAPI.URL)

@@ -413,6 +416,7 @@ func (oc *Collector) checkForNewReceivers(nginxConfigContext *model.NginxConfigC

reloadCollector = true
} else if nginxConfigContext.PlusAPI.URL == "" {
slog.Debug("Adding new Nginx Oss receiver", "url", nginxConfigContext.StubStatus.URL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
slog.Debug("Adding new Nginx Oss receiver", "url", nginxConfigContext.StubStatus.URL)
slog.Debug("Adding new NGINX OSS receiver", "url", nginxConfigContext.StubStatus.URL)

@@ -465,6 +469,8 @@ func (oc *Collector) updateExistingNginxPlusReceiver(
oc.config.Collector.Receivers.NginxPlusReceivers[index+1:]...,
)
if nginxConfigContext.PlusAPI.URL != "" {
slog.Debug("Updating existing Nginx Plus receiver", "url",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
slog.Debug("Updating existing Nginx Plus receiver", "url",
slog.Debug("Updating existing NGINX Plus receiver", "url",

@@ -496,6 +502,8 @@ func (oc *Collector) updateExistingNginxOSSReceiver(
oc.config.Collector.Receivers.NginxReceivers[index+1:]...,
)
if nginxConfigContext.StubStatus.URL != "" {
slog.Debug("Updating existing Nginx Oss receiver", "url",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
slog.Debug("Updating existing Nginx Oss receiver", "url",
slog.Debug("Updating existing NGINX OSS receiver", "url",

@oCHRISo oCHRISo added the v3.x Issues and Pull Requests related to the major version v3 label Jun 5, 2025
@aphralG aphralG merged commit 75905a1 into main Jun 10, 2025
38 of 39 checks passed
@aphralG aphralG deleted the clean-up-logging branch June 10, 2025 13:18
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 v3.x Issues and Pull Requests related to the major version v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants