-
Notifications
You must be signed in to change notification settings - Fork 129
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
base: main
Are you sure you want to change the base?
Conversation
This PR is still a draft until i finish updating the objects_test.go and add tests for the agent_labels.go collector |
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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.
internal/controller/manager.go
Outdated
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) | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 | ||
} | ||
|
There was a problem hiding this comment.
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.
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.
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.