Skip to content

Add connection to NGINX One Console #3676

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Add connection to NGINX One Console #3676

wants to merge 6 commits into from

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Jul 31, 2025

Proposed changes

Add connection to NGINX One Console by configuring Agent to sent telemetry data to NGINX One Console endpoint.

Problem:

Solution:

Testing:

Closes #3251

Checklist

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

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.


@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart labels Jul 31, 2025
@bjee19
Copy link
Contributor Author

bjee19 commented Jul 31, 2025

This PR is still a draft until i finish updating the objects_test.go and add tests for the agent_labels.go collector

Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 62.03209% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.82%. Comparing base (8e779fc) to head (9d53cb1).

Files with missing lines Patch % Lines
internal/controller/telemetry/agent_labels.go 0.00% 36 Missing ⚠️
internal/controller/manager.go 0.00% 26 Missing ⚠️
cmd/gateway/commands.go 91.54% 6 Missing ⚠️
internal/controller/provisioner/objects.go 93.87% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3676      +/-   ##
==========================================
- Coverage   87.07%   86.82%   -0.25%     
==========================================
  Files         127      128       +1     
  Lines       15602    15750     +148     
  Branches       62       62              
==========================================
+ Hits        13585    13675      +90     
- Misses       1858     1917      +59     
+ Partials      159      158       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

Sidenote regarding documentation, be sure we update the cli-help doc for the new CLI flags.

Comment on lines 203 to 216
agentLabelCollector := telemetry.NewLabelCollectorConfigImpl(telemetry.LabelCollectorConfig{
K8sClientReader: mgr.GetAPIReader(),
Version: cfg.GatewayPodConfig.Version,
PodNSName: types.NamespacedName{
Namespace: cfg.GatewayPodConfig.Namespace,
Name: cfg.GatewayPodConfig.Name,
},
})

agentLabels, err := agentLabelCollector.Collect(ctx)
if err != nil {
return fmt.Errorf("failed to collect agent labels: %w", err)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to be done here? Can we just gather this info in the Provisioner's constructor? This manager file is already pretty unwieldy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved it to the provisioner's constructor, though needed to do some weird changes to satisfy making a fake for the provisioner_test.

@@ -379,10 +406,18 @@ func (p *NginxProvisioner) buildNginxConfigMaps(
"Namespace": p.cfg.GatewayPodConfig.Namespace,
"EnableMetrics": enableMetrics,
"MetricsPort": metricsPort,
"AgentLabels": telemetry.AgentLabelsToMap(p.cfg.AgentLabels),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this conversion function? Why not just have the original value be of the proper format so we don't have to convert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored AgentLabels to be a map as I think this is suggesting, let me know if this wasn't correct.


spec.Spec.Containers[0].VolumeMounts = volumeMounts
}

return spec
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are a handful of missing pieces for the new Secret. store.go requires some updates, as well as buildNginxResourceObjectsForDeletion so we clean it up.

@github-project-automation github-project-automation bot moved this from 🆕 New to 🏗 In Progress in NGINX Gateway Fabric Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request helm-chart Relates to helm chart
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

Enable Connection to NGINX One Console
2 participants