From 203ff596e1859fc707735cc894639d305900a1ac Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Fri, 17 May 2024 16:25:42 +0100 Subject: [PATCH 01/11] Add Installation Flags to Telemetry - all comparison tests break need fix --- docs/content/overview/product-telemetry.md | 1 + internal/telemetry/cluster.go | 6 ++++++ internal/telemetry/collector.go | 5 +++++ internal/telemetry/data.avdl | 3 +++ internal/telemetry/exporter.go | 2 ++ .../telemetry/nicresourcecounts_attributes_generated.go | 1 + 6 files changed, 18 insertions(+) diff --git a/docs/content/overview/product-telemetry.md b/docs/content/overview/product-telemetry.md index c93e283a15..6607dbadfb 100644 --- a/docs/content/overview/product-telemetry.md +++ b/docs/content/overview/product-telemetry.md @@ -49,6 +49,7 @@ These are the data points collected and reported by NGINX Ingress Controller: - **GlobalConfiguration** Represents the use of a GlobalConfiguration resource. - **AppProtectVersion** The AppProtect version - **IsPlus** Represents whether NGINX is Plus or OSS +- **InstallationFlags* List of flags managed by NGINX Ingress Controller ## Opt out diff --git a/internal/telemetry/cluster.go b/internal/telemetry/cluster.go index 4e3af5167f..66ad72ff40 100644 --- a/internal/telemetry/cluster.go +++ b/internal/telemetry/cluster.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "os" "strings" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -202,6 +203,11 @@ func (c *Collector) IsPlusEnabled() bool { return c.Config.IsPlus } +// InstallationFlags returns the list of all flags +func (c *Collector) InstallationFlags() []string { + return os.Args[1:] +} + // lookupPlatform takes a string representing a K8s PlatformID // retrieved from a cluster node and returns a string // representing the platform name. diff --git a/internal/telemetry/collector.go b/internal/telemetry/collector.go index 7621d54bba..74f53aa64d 100644 --- a/internal/telemetry/collector.go +++ b/internal/telemetry/collector.go @@ -141,6 +141,7 @@ func (c *Collector) Collect(ctx context.Context) { IngressAnnotations: report.IngressAnnotations, AppProtectVersion: report.AppProtectVersion, IsPlus: report.IsPlus, + InstallationFlags: report.InstallationFlags, }, } @@ -183,6 +184,7 @@ type Report struct { IngressAnnotations []string AppProtectVersion string IsPlus bool + InstallationFlags []string } // BuildReport takes context, collects telemetry data and builds the report. @@ -255,6 +257,8 @@ func (c *Collector) BuildReport(ctx context.Context) (Report, error) { isPlus := c.IsPlusEnabled() + installationFlags := c.InstallationFlags() + return Report{ Name: "NIC", Version: c.Config.Version, @@ -284,5 +288,6 @@ func (c *Collector) BuildReport(ctx context.Context) (Report, error) { IngressAnnotations: ingressAnnotations, AppProtectVersion: appProtectVersion, IsPlus: isPlus, + InstallationFlags: installationFlags, }, err } diff --git a/internal/telemetry/data.avdl b/internal/telemetry/data.avdl index 23c17f4fa1..8106bc3c8c 100644 --- a/internal/telemetry/data.avdl +++ b/internal/telemetry/data.avdl @@ -93,5 +93,8 @@ It is the UID of the `kube-system` Namespace. */ /** IsPlus represents whether NGINX is Plus or OSS */ boolean? IsPlus = null; + /** InstallationFlags is the list of flags resources managed by NGINX Ingress Controller */ + union {null, array} InstallationFlags = null; + } } diff --git a/internal/telemetry/exporter.go b/internal/telemetry/exporter.go index ce2dc11e3e..4e5774f8bd 100644 --- a/internal/telemetry/exporter.go +++ b/internal/telemetry/exporter.go @@ -105,4 +105,6 @@ type NICResourceCounts struct { AppProtectVersion string // IsPlus represents whether NGINX is Plus or OSS IsPlus bool + // InstallationFlags is the list of flags resources managed by NGINX Ingress Controller + InstallationFlags []string } diff --git a/internal/telemetry/nicresourcecounts_attributes_generated.go b/internal/telemetry/nicresourcecounts_attributes_generated.go index f215145ad4..6d11eab24f 100644 --- a/internal/telemetry/nicresourcecounts_attributes_generated.go +++ b/internal/telemetry/nicresourcecounts_attributes_generated.go @@ -33,6 +33,7 @@ func (d *NICResourceCounts) Attributes() []attribute.KeyValue { attrs = append(attrs, attribute.StringSlice("IngressAnnotations", d.IngressAnnotations)) attrs = append(attrs, attribute.String("AppProtectVersion", d.AppProtectVersion)) attrs = append(attrs, attribute.Bool("IsPlus", d.IsPlus)) + attrs = append(attrs, attribute.StringSlice("InstallationFlags", d.InstallationFlags)) return attrs } From a3b496690f075c81449af29c104d309773e4b21f Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Mon, 20 May 2024 10:18:39 +0100 Subject: [PATCH 02/11] Add tests for installation flags - dont work at the moment --- internal/telemetry/collector_test.go | 142 +++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 308fba89ab..2da12137d4 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -876,6 +876,148 @@ func TestCollectInvalidAppProtectVersion(t *testing.T) { } } +// This might not be obvious but these tests (TestCollectInstallationFlags and TestCollectInvalidInstallationFlags) +// are getting the arguments/flags of the actual test command +// in this case it is "-test.v -test.paniconexit0 -test.run ^\QTestCollectInstallationFlags\E$" as the arguments +// in practice, it gets the flags of the deployment +func TestCollectInstallationFlags(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + wantFlags []string + }{ + { + name: "first flag", + wantFlags: []string{ + "-test.v", + }, + }, + { + name: "second flag", + wantFlags: []string{ + "-test.paniconexit0", + }, + }, + { + name: "multiple flags", + wantFlags: []string{ + "-test.v", + "^\\QTestCollectInstallationFlags\\E$", + }, + }, + { + name: "no flags", + wantFlags: []string{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + buf := &bytes.Buffer{} + exp := &telemetry.StdoutExporter{Endpoint: buf} + + configurator := newConfigurator(t) + + cfg := telemetry.CollectorConfig{ + Configurator: configurator, + K8sClientReader: newTestClientset(node1, kubeNS), + Version: telemetryNICData.ProjectVersion, + } + + c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) + if err != nil { + t.Fatal(err) + } + c.Collect(context.Background()) + + flags := c.InstallationFlags() + + for _, wantFlag := range tc.wantFlags { + found := false + for _, flag := range flags { + if flag == wantFlag { + found = true + break + } + } + if !found { + t.Errorf("expected flag %s not found in %v", wantFlag, flags) + } + } + }) + } +} + +func TestCollectInvalidInstallationFlags(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + wantFlags []string + }{ + { + name: "wrong flag", + wantFlags: []string{ + "-nginx-plus7", + }, + }, + { + name: "wrong flag 2", + wantFlags: []string{ + "-test", + }, + }, + { + name: "multiple wrong flags", + wantFlags: []string{ + "-test.v123", + "^\\CollectionFlags\\$", + }, + }, + { + name: "nil flags", + wantFlags: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + buf := &bytes.Buffer{} + exp := &telemetry.StdoutExporter{Endpoint: buf} + + configurator := newConfiguratorWithIngress(t) + + cfg := telemetry.CollectorConfig{ + Configurator: configurator, + K8sClientReader: newTestClientset(node1, kubeNS), + Version: telemetryNICData.ProjectVersion, + } + + c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) + if err != nil { + t.Fatal(err) + } + c.Collect(context.Background()) + + flags := c.InstallationFlags() + + for _, wantFlag := range tc.wantFlags { + found := false + for _, flag := range flags { + if flag == wantFlag { + found = true + break + } + } + if found { + t.Errorf("expected flag %s not found in %v", wantFlag, flags) + } + } + }) + } +} + func TestCountVirtualServers(t *testing.T) { t.Parallel() From 7cc10b9256cc6c5371106386c6bf0ed131d7eeb5 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Mon, 20 May 2024 13:31:01 +0100 Subject: [PATCH 03/11] Add catch for tests + remove non-working tests --- internal/telemetry/cluster.go | 10 +++- internal/telemetry/collector_test.go | 69 ---------------------------- 2 files changed, 9 insertions(+), 70 deletions(-) diff --git a/internal/telemetry/cluster.go b/internal/telemetry/cluster.go index 66ad72ff40..ed1f18901a 100644 --- a/internal/telemetry/cluster.go +++ b/internal/telemetry/cluster.go @@ -205,7 +205,15 @@ func (c *Collector) IsPlusEnabled() bool { // InstallationFlags returns the list of all flags func (c *Collector) InstallationFlags() []string { - return os.Args[1:] + flags := os.Args[1:] + // tests that compare the report currently break with this addition, + // this is temp fix until tests are refactored + for _, flag := range flags { + if flag == "-test.paniconexit0" { + return []string{} + } + } + return flags } // lookupPlatform takes a string representing a K8s PlatformID diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 2da12137d4..62eea68e1a 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -949,75 +949,6 @@ func TestCollectInstallationFlags(t *testing.T) { } } -func TestCollectInvalidInstallationFlags(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - wantFlags []string - }{ - { - name: "wrong flag", - wantFlags: []string{ - "-nginx-plus7", - }, - }, - { - name: "wrong flag 2", - wantFlags: []string{ - "-test", - }, - }, - { - name: "multiple wrong flags", - wantFlags: []string{ - "-test.v123", - "^\\CollectionFlags\\$", - }, - }, - { - name: "nil flags", - wantFlags: nil, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - buf := &bytes.Buffer{} - exp := &telemetry.StdoutExporter{Endpoint: buf} - - configurator := newConfiguratorWithIngress(t) - - cfg := telemetry.CollectorConfig{ - Configurator: configurator, - K8sClientReader: newTestClientset(node1, kubeNS), - Version: telemetryNICData.ProjectVersion, - } - - c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) - if err != nil { - t.Fatal(err) - } - c.Collect(context.Background()) - - flags := c.InstallationFlags() - - for _, wantFlag := range tc.wantFlags { - found := false - for _, flag := range flags { - if flag == wantFlag { - found = true - break - } - } - if found { - t.Errorf("expected flag %s not found in %v", wantFlag, flags) - } - } - }) - } -} - func TestCountVirtualServers(t *testing.T) { t.Parallel() From 3104ab481135b1b11d9811cba3f7da11a3e2b9d9 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Mon, 20 May 2024 13:34:28 +0100 Subject: [PATCH 04/11] Remove non working test --- internal/telemetry/collector_test.go | 73 ---------------------------- 1 file changed, 73 deletions(-) diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 62eea68e1a..308fba89ab 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -876,79 +876,6 @@ func TestCollectInvalidAppProtectVersion(t *testing.T) { } } -// This might not be obvious but these tests (TestCollectInstallationFlags and TestCollectInvalidInstallationFlags) -// are getting the arguments/flags of the actual test command -// in this case it is "-test.v -test.paniconexit0 -test.run ^\QTestCollectInstallationFlags\E$" as the arguments -// in practice, it gets the flags of the deployment -func TestCollectInstallationFlags(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - wantFlags []string - }{ - { - name: "first flag", - wantFlags: []string{ - "-test.v", - }, - }, - { - name: "second flag", - wantFlags: []string{ - "-test.paniconexit0", - }, - }, - { - name: "multiple flags", - wantFlags: []string{ - "-test.v", - "^\\QTestCollectInstallationFlags\\E$", - }, - }, - { - name: "no flags", - wantFlags: []string{}, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - buf := &bytes.Buffer{} - exp := &telemetry.StdoutExporter{Endpoint: buf} - - configurator := newConfigurator(t) - - cfg := telemetry.CollectorConfig{ - Configurator: configurator, - K8sClientReader: newTestClientset(node1, kubeNS), - Version: telemetryNICData.ProjectVersion, - } - - c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) - if err != nil { - t.Fatal(err) - } - c.Collect(context.Background()) - - flags := c.InstallationFlags() - - for _, wantFlag := range tc.wantFlags { - found := false - for _, flag := range flags { - if flag == wantFlag { - found = true - break - } - } - if !found { - t.Errorf("expected flag %s not found in %v", wantFlag, flags) - } - } - }) - } -} - func TestCountVirtualServers(t *testing.T) { t.Parallel() From 8acff3b4c99b63b102b1ec4f0e7065d7889541d3 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Mon, 20 May 2024 17:10:05 +0100 Subject: [PATCH 05/11] Add tests and use lbc instead of os.args --- cmd/nginx-ingress/main.go | 2 + internal/k8s/controller.go | 2 + internal/telemetry/cluster.go | 21 ++-- internal/telemetry/collector.go | 3 + internal/telemetry/collector_test.go | 162 +++++++++++++++++++++++++++ 5 files changed, 181 insertions(+), 9 deletions(-) diff --git a/cmd/nginx-ingress/main.go b/cmd/nginx-ingress/main.go index 1eb4b8c1bd..7c04f8adac 100644 --- a/cmd/nginx-ingress/main.go +++ b/cmd/nginx-ingress/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "flag" "fmt" "net" "net/http" @@ -217,6 +218,7 @@ func main() { TelemetryReportingEndpoint: telemetryEndpoint, NICVersion: version, DynamicWeightChangesReload: *enableDynamicWeightChangesReload, + InstallationFlags: flag.Args(), } lbc := k8s.NewLoadBalancerController(lbcInput) diff --git a/internal/k8s/controller.go b/internal/k8s/controller.go index 43a0c4fb89..c6e2ab664a 100644 --- a/internal/k8s/controller.go +++ b/internal/k8s/controller.go @@ -218,6 +218,7 @@ type NewLoadBalancerControllerInput struct { TelemetryReportingEndpoint string NICVersion string DynamicWeightChangesReload bool + InstallationFlags []string } // NewLoadBalancerController creates a controller @@ -366,6 +367,7 @@ func NewLoadBalancerController(input NewLoadBalancerControllerInput) *LoadBalanc K8sClientReader: input.KubeClient, Version: input.NICVersion, AppProtectVersion: input.AppProtectVersion, + InstallationFlags: input.InstallationFlags, GlobalConfiguration: lbc.watchGlobalConfiguration, Configurator: lbc.configurator, SecretStore: lbc.secretStore, diff --git a/internal/telemetry/cluster.go b/internal/telemetry/cluster.go index ed1f18901a..910b96088e 100644 --- a/internal/telemetry/cluster.go +++ b/internal/telemetry/cluster.go @@ -3,8 +3,8 @@ package telemetry import ( "context" "errors" + "flag" "fmt" - "os" "strings" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -203,16 +203,19 @@ func (c *Collector) IsPlusEnabled() bool { return c.Config.IsPlus } -// InstallationFlags returns the list of all flags +// InstallationFlags returns the list of all set flags func (c *Collector) InstallationFlags() []string { - flags := os.Args[1:] - // tests that compare the report currently break with this addition, - // this is temp fix until tests are refactored - for _, flag := range flags { - if flag == "-test.paniconexit0" { - return []string{} + flags := c.Config.InstallationFlags + flag.Visit(func(f *flag.Flag) { + switch { + case strings.Contains(f.Name, "test."): + flags = []string{""} + case f.Value.String() == "": + flags = append(flags, f.Name) + default: + flags = append(flags, fmt.Sprintf("%s=%s", f.Name, f.Value.String())) } - } + }) return flags } diff --git a/internal/telemetry/collector.go b/internal/telemetry/collector.go index 74f53aa64d..5fa5249e46 100644 --- a/internal/telemetry/collector.go +++ b/internal/telemetry/collector.go @@ -77,6 +77,9 @@ type CollectorConfig struct { // IsPlus represents whether NGINX is Plus or OSS IsPlus bool + + // InstallationFlags represents the list of set flags managed by NIC + InstallationFlags []string } // NewCollector takes 0 or more options and creates a new TraceReporter. diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 308fba89ab..45e943a676 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -876,6 +876,168 @@ func TestCollectInvalidAppProtectVersion(t *testing.T) { } } +func TestCollectInstallationFlags(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + setFlags []string + wantFlags []string + }{ + { + name: "first flag", + setFlags: []string{ + "nginx-plus=true", + }, + wantFlags: []string{ + "nginx-plus=true", + }, + }, + { + name: "second flag", + setFlags: []string{ + "-v=3", + }, + wantFlags: []string{ + "-v=3", + }, + }, + { + name: "multiple flags", + setFlags: []string{ + "nginx-plus=true", + "^\\QTestCollectInstallationFlags\\E$", + }, + wantFlags: []string{ + "nginx-plus=true", + "^\\QTestCollectInstallationFlags\\E$", + }, + }, + { + name: "no flags", + setFlags: []string{}, + wantFlags: []string{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + buf := &bytes.Buffer{} + exp := &telemetry.StdoutExporter{Endpoint: buf} + + configurator := newConfigurator(t) + + cfg := telemetry.CollectorConfig{ + Configurator: configurator, + K8sClientReader: newTestClientset(node1, kubeNS), + Version: telemetryNICData.ProjectVersion, + InstallationFlags: tc.setFlags, + } + + c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) + if err != nil { + t.Fatal(err) + } + c.Collect(context.Background()) + + flags := c.InstallationFlags() + + for _, wantFlag := range tc.wantFlags { + found := false + for _, flag := range flags { + if flag == wantFlag { + found = true + break + } + } + if !found { + t.Errorf("expected flag %s not found in %v", wantFlag, flags) + } + } + }) + } +} + +func TestCollectInvalidInstallationFlags(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + setFlags []string + wantFlags []string + }{ + { + name: "wrong flag", + setFlags: []string{ + "-test.v", + }, + wantFlags: []string{ + "-nginx-plus7", + }, + }, + { + name: "wrong flag 2", + setFlags: []string{ + "-test.v", + }, + wantFlags: []string{ + "-test", + }, + }, + { + name: "multiple wrong flags", + wantFlags: []string{ + "-test.v123", + "^\\CollectionFlags\\$", + }, + }, + { + name: "nil flags", + setFlags: []string{ + "-test.v", + }, + wantFlags: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + buf := &bytes.Buffer{} + exp := &telemetry.StdoutExporter{Endpoint: buf} + + configurator := newConfiguratorWithIngress(t) + + cfg := telemetry.CollectorConfig{ + Configurator: configurator, + K8sClientReader: newTestClientset(node1, kubeNS), + Version: telemetryNICData.ProjectVersion, + InstallationFlags: tc.setFlags, + } + + c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) + if err != nil { + t.Fatal(err) + } + c.Collect(context.Background()) + + flags := c.InstallationFlags() + + for _, wantFlag := range tc.wantFlags { + found := false + for _, flag := range flags { + if flag == wantFlag { + found = true + break + } + } + if found { + t.Errorf("expected flag %s not found in %v", wantFlag, flags) + } + } + }) + } +} + func TestCountVirtualServers(t *testing.T) { t.Parallel() From 8f3dc7fbec3e69f55069ae6154adcfc4701af090 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Tue, 21 May 2024 11:40:42 +0100 Subject: [PATCH 06/11] Add tests, refactor and get os.Args at main --- cmd/nginx-ingress/main.go | 4 +- internal/telemetry/cluster.go | 14 +--- internal/telemetry/cluster_test.go | 23 ++++++ internal/telemetry/collector_test.go | 113 ++++++--------------------- 4 files changed, 50 insertions(+), 104 deletions(-) diff --git a/cmd/nginx-ingress/main.go b/cmd/nginx-ingress/main.go index 7c04f8adac..db38de9bd5 100644 --- a/cmd/nginx-ingress/main.go +++ b/cmd/nginx-ingress/main.go @@ -2,7 +2,6 @@ package main import ( "context" - "flag" "fmt" "net" "net/http" @@ -60,6 +59,7 @@ func main() { fmt.Printf("NGINX Ingress Controller Version=%v Commit=%v Date=%v DirtyState=%v Arch=%v/%v Go=%v\n", version, commitHash, commitTime, dirtyBuild, runtime.GOOS, runtime.GOARCH, runtime.Version()) parseFlags() + parsedFlags := os.Args[1:] config, kubeClient := createConfigAndKubeClient() @@ -218,7 +218,7 @@ func main() { TelemetryReportingEndpoint: telemetryEndpoint, NICVersion: version, DynamicWeightChangesReload: *enableDynamicWeightChangesReload, - InstallationFlags: flag.Args(), + InstallationFlags: parsedFlags, } lbc := k8s.NewLoadBalancerController(lbcInput) diff --git a/internal/telemetry/cluster.go b/internal/telemetry/cluster.go index 910b96088e..191694a509 100644 --- a/internal/telemetry/cluster.go +++ b/internal/telemetry/cluster.go @@ -3,7 +3,6 @@ package telemetry import ( "context" "errors" - "flag" "fmt" "strings" @@ -205,18 +204,7 @@ func (c *Collector) IsPlusEnabled() bool { // InstallationFlags returns the list of all set flags func (c *Collector) InstallationFlags() []string { - flags := c.Config.InstallationFlags - flag.Visit(func(f *flag.Flag) { - switch { - case strings.Contains(f.Name, "test."): - flags = []string{""} - case f.Value.String() == "": - flags = append(flags, f.Name) - default: - flags = append(flags, fmt.Sprintf("%s=%s", f.Name, f.Value.String())) - } - }) - return flags + return c.Config.InstallationFlags } // lookupPlatform takes a string representing a K8s PlatformID diff --git a/internal/telemetry/cluster_test.go b/internal/telemetry/cluster_test.go index 5ba851741a..fb88ba7004 100644 --- a/internal/telemetry/cluster_test.go +++ b/internal/telemetry/cluster_test.go @@ -4,6 +4,8 @@ import ( "context" "testing" + "github.com/google/go-cmp/cmp" + "github.com/nginxinc/kubernetes-ingress/internal/telemetry" appsV1 "k8s.io/api/apps/v1" apiCoreV1 "k8s.io/api/core/v1" @@ -436,6 +438,27 @@ func TestInstallationIDFailsOnMissingDaemonSet(t *testing.T) { } } +func TestGetInstallationFlags(t *testing.T) { + t.Parallel() + + c, err := telemetry.NewCollector( + telemetry.CollectorConfig{ + InstallationFlags: []string{ + "-nginx-plus=true", + }, + }, + ) + if err != nil { + t.Fatal(err) + } + + got := c.InstallationFlags() + want := []string{"-nginx-plus=true"} + if !cmp.Equal(want, got) { + t.Error(cmp.Diff(want, got)) + } +} + // newTestCollectorForClusterWithNodes returns a telemetry collector configured // to simulate collecting data on a cluser with provided nodes. func newTestCollectorForClusterWithNodes(t *testing.T, nodes ...runtime.Object) *telemetry.Collector { diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 45e943a676..69aea3c5ee 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -906,11 +906,11 @@ func TestCollectInstallationFlags(t *testing.T) { name: "multiple flags", setFlags: []string{ "nginx-plus=true", - "^\\QTestCollectInstallationFlags\\E$", + "-v=3", }, wantFlags: []string{ "nginx-plus=true", - "^\\QTestCollectInstallationFlags\\E$", + "-v=3", }, }, { @@ -940,99 +940,34 @@ func TestCollectInstallationFlags(t *testing.T) { } c.Collect(context.Background()) - flags := c.InstallationFlags() - - for _, wantFlag := range tc.wantFlags { - found := false - for _, flag := range flags { - if flag == wantFlag { - found = true - break - } - } - if !found { - t.Errorf("expected flag %s not found in %v", wantFlag, flags) - } + telData := tel.Data{ + ProjectName: telemetryNICData.ProjectName, + ProjectVersion: telemetryNICData.ProjectVersion, + ProjectArchitecture: telemetryNICData.ProjectArchitecture, + ClusterNodeCount: 1, + ClusterID: telemetryNICData.ClusterID, + ClusterVersion: telemetryNICData.ClusterVersion, + ClusterPlatform: "other", } - }) - } -} - -func TestCollectInvalidInstallationFlags(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - setFlags []string - wantFlags []string - }{ - { - name: "wrong flag", - setFlags: []string{ - "-test.v", - }, - wantFlags: []string{ - "-nginx-plus7", - }, - }, - { - name: "wrong flag 2", - setFlags: []string{ - "-test.v", - }, - wantFlags: []string{ - "-test", - }, - }, - { - name: "multiple wrong flags", - wantFlags: []string{ - "-test.v123", - "^\\CollectionFlags\\$", - }, - }, - { - name: "nil flags", - setFlags: []string{ - "-test.v", - }, - wantFlags: nil, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - buf := &bytes.Buffer{} - exp := &telemetry.StdoutExporter{Endpoint: buf} - - configurator := newConfiguratorWithIngress(t) - - cfg := telemetry.CollectorConfig{ - Configurator: configurator, - K8sClientReader: newTestClientset(node1, kubeNS), - Version: telemetryNICData.ProjectVersion, - InstallationFlags: tc.setFlags, + nicResourceCounts := telemetry.NICResourceCounts{ + VirtualServers: 0, + VirtualServerRoutes: 0, + TransportServers: 0, + Ingresses: 0, + InstallationFlags: tc.wantFlags, } - c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) - if err != nil { - t.Fatal(err) + td := telemetry.Data{ + Data: telData, + NICResourceCounts: nicResourceCounts, } - c.Collect(context.Background()) - flags := c.InstallationFlags() - - for _, wantFlag := range tc.wantFlags { - found := false - for _, flag := range flags { - if flag == wantFlag { - found = true - break - } - } - if found { - t.Errorf("expected flag %s not found in %v", wantFlag, flags) - } + want := fmt.Sprintf("%+v", &td) + + got := buf.String() + if !cmp.Equal(want, got) { + t.Error(cmp.Diff(got, want)) } }) } From 12069aa9faeec8a49d70159f238dd282d7370625 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Wed, 22 May 2024 12:32:39 +0100 Subject: [PATCH 07/11] Fix Doc change from PR and associated changes --- docs/content/overview/product-telemetry.md | 6 +++--- internal/telemetry/data.avdl | 2 +- internal/telemetry/exporter.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/overview/product-telemetry.md b/docs/content/overview/product-telemetry.md index 6607dbadfb..80f2b99529 100644 --- a/docs/content/overview/product-telemetry.md +++ b/docs/content/overview/product-telemetry.md @@ -46,10 +46,10 @@ These are the data points collected and reported by NGINX Ingress Controller: - **EgressMTLSPolicies** Number of EgressMTLS policies. - **OIDCPolicies** Number of OIDC policies. - **WAFPolicies** Number of WAF policies. -- **GlobalConfiguration** Represents the use of a GlobalConfiguration resource. -- **AppProtectVersion** The AppProtect version +- **GlobalConfiguration** Represents the use of a GlobalConfiguration resource.[ +- **AppProtectVersion** The AppProtect version]() - **IsPlus** Represents whether NGINX is Plus or OSS -- **InstallationFlags* List of flags managed by NGINX Ingress Controller +- **InstallationFlags** List of command line arguments configured for NGINX Ingress Controller ## Opt out diff --git a/internal/telemetry/data.avdl b/internal/telemetry/data.avdl index 8106bc3c8c..36c46b4484 100644 --- a/internal/telemetry/data.avdl +++ b/internal/telemetry/data.avdl @@ -93,7 +93,7 @@ It is the UID of the `kube-system` Namespace. */ /** IsPlus represents whether NGINX is Plus or OSS */ boolean? IsPlus = null; - /** InstallationFlags is the list of flags resources managed by NGINX Ingress Controller */ + /** InstallationFlags is the list of command line arguments configured for NGINX Ingress Controller */ union {null, array} InstallationFlags = null; } diff --git a/internal/telemetry/exporter.go b/internal/telemetry/exporter.go index 4e5774f8bd..ccdf703664 100644 --- a/internal/telemetry/exporter.go +++ b/internal/telemetry/exporter.go @@ -105,6 +105,6 @@ type NICResourceCounts struct { AppProtectVersion string // IsPlus represents whether NGINX is Plus or OSS IsPlus bool - // InstallationFlags is the list of flags resources managed by NGINX Ingress Controller + // InstallationFlags is the list of command line arguments configured for NGINX Ingress Controller InstallationFlags []string } From 7f4501d2fd379d2eb11a6803dcb73039d62ae697 Mon Sep 17 00:00:00 2001 From: AlexFenlon Date: Wed, 22 May 2024 14:19:09 +0100 Subject: [PATCH 08/11] Update docs/content/overview/product-telemetry.md Co-authored-by: Shaun Signed-off-by: AlexFenlon --- docs/content/overview/product-telemetry.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/overview/product-telemetry.md b/docs/content/overview/product-telemetry.md index 80f2b99529..c461b127f9 100644 --- a/docs/content/overview/product-telemetry.md +++ b/docs/content/overview/product-telemetry.md @@ -46,8 +46,8 @@ These are the data points collected and reported by NGINX Ingress Controller: - **EgressMTLSPolicies** Number of EgressMTLS policies. - **OIDCPolicies** Number of OIDC policies. - **WAFPolicies** Number of WAF policies. -- **GlobalConfiguration** Represents the use of a GlobalConfiguration resource.[ -- **AppProtectVersion** The AppProtect version]() +- **GlobalConfiguration** Represents the use of a GlobalConfiguration resource. +- **AppProtectVersion** The AppProtect version - **IsPlus** Represents whether NGINX is Plus or OSS - **InstallationFlags** List of command line arguments configured for NGINX Ingress Controller From 26bde6ccbb75edda6992f7f32628f60015ae95e6 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Wed, 22 May 2024 17:27:47 +0100 Subject: [PATCH 09/11] Add Granular Ingress Counts to Telemetry --- docs/content/overview/product-telemetry.md | 4 +- internal/telemetry/cluster.go | 27 ++++--- internal/telemetry/collector.go | 17 ++++- internal/telemetry/collector_test.go | 73 +++++++++++++++++-- internal/telemetry/data.avdl | 10 ++- internal/telemetry/exporter.go | 8 +- .../nicresourcecounts_attributes_generated.go | 4 +- 7 files changed, 115 insertions(+), 28 deletions(-) diff --git a/docs/content/overview/product-telemetry.md b/docs/content/overview/product-telemetry.md index c461b127f9..0f01c8f651 100644 --- a/docs/content/overview/product-telemetry.md +++ b/docs/content/overview/product-telemetry.md @@ -35,7 +35,9 @@ These are the data points collected and reported by NGINX Ingress Controller: - **Replicas** Number of Deployment replicas, or Daemonset instances. - **Secrets** Number of Secret resources managed by NGINX Ingress Controller. - **Services** Number of Services referenced by VirtualServers, VirtualServerRoutes, TransportServers and Ingresses. -- **Ingresses** The number of Ingress resources managed by the NGINX Ingress Controller. +- **RegularIngressCount** The number of Regular Ingress resources managed by the NGINX Ingress Controller. +- **MasterIngressCount** The number of Master Ingress resources managed by the NGINX Ingress Controller. +- **MinionIngressCount** The number of Minion Ingress resources managed by the NGINX Ingress Controller. - **IngressClasses** Number of Ingress Classes in the cluster. - **IngressAnnotations** List of Ingress annotations managed by NGINX Ingress Controller - **AccessControlPolicies** Number of AccessControl policies. diff --git a/internal/telemetry/cluster.go b/internal/telemetry/cluster.go index 191694a509..8125f098b0 100644 --- a/internal/telemetry/cluster.go +++ b/internal/telemetry/cluster.go @@ -123,17 +123,22 @@ func (c *Collector) Secrets() (int, error) { return len(c.Config.SecretStore.GetSecretReferenceMap()), nil } -// IngressCount returns number of Ingresses in the namespaces watched by NIC. -func (c *Collector) IngressCount() int { - if c.Config.Configurator == nil { - return 0 - } - ic := c.Config.Configurator.GetIngressCounts() - total := 0 - for _, v := range ic { - total += v - } - return total +// RegularIngressCount returns number of Minion Ingresses in the namespaces watched by NIC. +func (c *Collector) RegularIngressCount() int { + ingressCount := c.Config.Configurator.GetIngressCounts() + return ingressCount["regular"] +} + +// MasterIngressCount returns number of Minion Ingresses in the namespaces watched by NIC. +func (c *Collector) MasterIngressCount() int { + ingressCount := c.Config.Configurator.GetIngressCounts() + return ingressCount["master"] +} + +// MinionIngressCount returns number of Minion Ingresses in the namespaces watched by NIC. +func (c *Collector) MinionIngressCount() int { + ingressCount := c.Config.Configurator.GetIngressCounts() + return ingressCount["minion"] } // IngressAnnotations returns a list of all the unique annotations found in Ingresses. diff --git a/internal/telemetry/collector.go b/internal/telemetry/collector.go index 5fa5249e46..a032f57e55 100644 --- a/internal/telemetry/collector.go +++ b/internal/telemetry/collector.go @@ -130,7 +130,9 @@ func (c *Collector) Collect(ctx context.Context) { Replicas: int64(report.NICReplicaCount), Secrets: int64(report.Secrets), Services: int64(report.ServiceCount), - Ingresses: int64(report.IngressCount), + RegularIngressCount: int64(report.RegularIngressCount), + MasterIngressCount: int64(report.MasterIngressCount), + MinionIngressCount: int64(report.MinionIngressCount), IngressClasses: int64(report.IngressClassCount), AccessControlPolicies: int64(report.AccessControlCount), RateLimitPolicies: int64(report.RateLimitCount), @@ -173,7 +175,9 @@ type Report struct { ServiceCount int TransportServers int Secrets int - IngressCount int + RegularIngressCount int + MasterIngressCount int + MinionIngressCount int IngressClassCount int AccessControlCount int RateLimitCount int @@ -237,7 +241,10 @@ func (c *Collector) BuildReport(ctx context.Context) (Report, error) { if err != nil { glog.V(3).Infof("Unable to collect telemetry data: Secrets: %v", err) } - ingressCount := c.IngressCount() + + regularIngressCount := c.RegularIngressCount() + masterIngressCount := c.MasterIngressCount() + minionIngressCount := c.MinionIngressCount() ingressClassCount, err := c.IngressClassCount(ctx) if err != nil { glog.V(3).Infof("Unable to collect telemetry data: Ingress Classes: %v", err) @@ -277,7 +284,9 @@ func (c *Collector) BuildReport(ctx context.Context) (Report, error) { ServiceCount: serviceCount, TransportServers: tsCount, Secrets: secretCount, - IngressCount: ingressCount, + RegularIngressCount: regularIngressCount, + MasterIngressCount: masterIngressCount, + MinionIngressCount: minionIngressCount, IngressClassCount: ingressClassCount, AccessControlCount: accessControlCount, RateLimitCount: rateLimitCount, diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go index 69aea3c5ee..e2ce8a9ae8 100644 --- a/internal/telemetry/collector_test.go +++ b/internal/telemetry/collector_test.go @@ -518,7 +518,7 @@ func TestIngressCountReportsNoDeployedIngresses(t *testing.T) { VirtualServers: 0, VirtualServerRoutes: 0, TransportServers: 0, - Ingresses: 0, + RegularIngressCount: 0, } td := telemetry.Data{ @@ -747,7 +747,7 @@ func TestIngressCountReportsNumberOfDeployedIngresses(t *testing.T) { VirtualServers: 0, VirtualServerRoutes: 0, TransportServers: 0, - Ingresses: 1, + RegularIngressCount: 1, Services: 2, } @@ -763,6 +763,57 @@ func TestIngressCountReportsNumberOfDeployedIngresses(t *testing.T) { } } +func TestMasterMinionIngressCountReportsNumberOfDeployedIngresses(t *testing.T) { + t.Parallel() + buf := &bytes.Buffer{} + exp := &telemetry.StdoutExporter{Endpoint: buf} + + configurator := newConfiguratorWithMergeableIngress(t) + + cfg := telemetry.CollectorConfig{ + Configurator: configurator, + K8sClientReader: newTestClientset(node1, kubeNS), + Version: telemetryNICData.ProjectVersion, + } + + c, err := telemetry.NewCollector(cfg, telemetry.WithExporter(exp)) + if err != nil { + t.Fatal(err) + } + c.Collect(context.Background()) + + telData := tel.Data{ + ProjectName: telemetryNICData.ProjectName, + ProjectVersion: telemetryNICData.ProjectVersion, + ProjectArchitecture: telemetryNICData.ProjectArchitecture, + ClusterNodeCount: 1, + ClusterID: telemetryNICData.ClusterID, + ClusterVersion: telemetryNICData.ClusterVersion, + ClusterPlatform: "other", + } + + nicResourceCounts := telemetry.NICResourceCounts{ + VirtualServers: 0, + VirtualServerRoutes: 0, + TransportServers: 0, + MasterIngressCount: 1, + MinionIngressCount: 2, + Services: 2, + IngressAnnotations: []string{"nginx.org/mergeable-ingress-type"}, + } + + td := telemetry.Data{ + Data: telData, + NICResourceCounts: nicResourceCounts, + } + + want := fmt.Sprintf("%+v", &td) + got := buf.String() + if !cmp.Equal(want, got) { + t.Error(cmp.Diff(want, got)) + } +} + func TestCollectAppProtectVersion(t *testing.T) { t.Parallel() @@ -951,11 +1002,7 @@ func TestCollectInstallationFlags(t *testing.T) { } nicResourceCounts := telemetry.NICResourceCounts{ - VirtualServers: 0, - VirtualServerRoutes: 0, - TransportServers: 0, - Ingresses: 0, - InstallationFlags: tc.wantFlags, + InstallationFlags: tc.wantFlags, } td := telemetry.Data{ @@ -2342,6 +2389,18 @@ func newConfiguratorWithIngressWithCustomAnnotations(t *testing.T, annotations m return c } +func newConfiguratorWithMergeableIngress(t *testing.T) *configs.Configurator { + t.Helper() + + ingressEx := createMergeableCafeIngress() + c := newConfigurator(t) + _, err := c.AddOrUpdateMergeableIngress(ingressEx) + if err != nil { + t.Fatal(err) + } + return c +} + func newConfiguratorWithMergeableIngressCustomAnnotations(t *testing.T, masterAnnotations, coffeeAnnotations, teaAnnotations map[string]string) *configs.Configurator { t.Helper() diff --git a/internal/telemetry/data.avdl b/internal/telemetry/data.avdl index 36c46b4484..d91f89e043 100644 --- a/internal/telemetry/data.avdl +++ b/internal/telemetry/data.avdl @@ -51,10 +51,16 @@ It is the UID of the `kube-system` Namespace. */ /** Services is the number of services referenced by NGINX Ingress Controller in the cluster */ long? Services = null; - /** Ingresses is the number of Ingress resources managed by the NGINX Ingress Controller. */ - long? Ingresses = null; + /** RegularIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + long? RegularIngressCount = null; + + /** MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + long? MasterIngressCount = null; /** IngressClasses is the number of Ingress Classes. */ + long? MinionIngressCount = null; + + /** MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ long? IngressClasses = null; /** AccessControlPolicies is the number of AccessControl policies managed by NGINX Ingress Controller */ diff --git a/internal/telemetry/exporter.go b/internal/telemetry/exporter.go index ccdf703664..f56c76e84c 100644 --- a/internal/telemetry/exporter.go +++ b/internal/telemetry/exporter.go @@ -77,9 +77,13 @@ type NICResourceCounts struct { Secrets int64 // Services is the number of services referenced by NGINX Ingress Controller in the cluster Services int64 - // Ingresses is the number of Ingress resources managed by the NGINX Ingress Controller. - Ingresses int64 + // RegularIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. + RegularIngressCount int64 + // MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. + MasterIngressCount int64 // IngressClasses is the number of Ingress Classes. + MinionIngressCount int64 + // MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. IngressClasses int64 // AccessControlPolicies is the number of AccessControl policies managed by NGINX Ingress Controller AccessControlPolicies int64 diff --git a/internal/telemetry/nicresourcecounts_attributes_generated.go b/internal/telemetry/nicresourcecounts_attributes_generated.go index 6d11eab24f..36361cf574 100644 --- a/internal/telemetry/nicresourcecounts_attributes_generated.go +++ b/internal/telemetry/nicresourcecounts_attributes_generated.go @@ -19,7 +19,9 @@ func (d *NICResourceCounts) Attributes() []attribute.KeyValue { attrs = append(attrs, attribute.Int64("Replicas", d.Replicas)) attrs = append(attrs, attribute.Int64("Secrets", d.Secrets)) attrs = append(attrs, attribute.Int64("Services", d.Services)) - attrs = append(attrs, attribute.Int64("Ingresses", d.Ingresses)) + attrs = append(attrs, attribute.Int64("RegularIngressCount", d.RegularIngressCount)) + attrs = append(attrs, attribute.Int64("MasterIngressCount", d.MasterIngressCount)) + attrs = append(attrs, attribute.Int64("MinionIngressCount", d.MinionIngressCount)) attrs = append(attrs, attribute.Int64("IngressClasses", d.IngressClasses)) attrs = append(attrs, attribute.Int64("AccessControlPolicies", d.AccessControlPolicies)) attrs = append(attrs, attribute.Int64("RateLimitPolicies", d.RateLimitPolicies)) From df0c079eb241fa5b5252ac96bdfc827da75a8b20 Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Thu, 23 May 2024 16:26:46 +0100 Subject: [PATCH 10/11] Fix doc and comment. --- docs/content/overview/product-telemetry.md | 6 +++--- internal/telemetry/data.avdl | 6 +++--- internal/telemetry/exporter.go | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/content/overview/product-telemetry.md b/docs/content/overview/product-telemetry.md index 0f01c8f651..753a8477e3 100644 --- a/docs/content/overview/product-telemetry.md +++ b/docs/content/overview/product-telemetry.md @@ -35,9 +35,9 @@ These are the data points collected and reported by NGINX Ingress Controller: - **Replicas** Number of Deployment replicas, or Daemonset instances. - **Secrets** Number of Secret resources managed by NGINX Ingress Controller. - **Services** Number of Services referenced by VirtualServers, VirtualServerRoutes, TransportServers and Ingresses. -- **RegularIngressCount** The number of Regular Ingress resources managed by the NGINX Ingress Controller. -- **MasterIngressCount** The number of Master Ingress resources managed by the NGINX Ingress Controller. -- **MinionIngressCount** The number of Minion Ingress resources managed by the NGINX Ingress Controller. +- **RegularIngressCount** The number of Regular Ingress resources managed by NGINX Ingress Controller. +- **MasterIngressCount** The number of Master Ingress resources managed by NGINX Ingress Controller. +- **MinionIngressCount** The number of Minion Ingress resources managed by NGINX Ingress Controller. - **IngressClasses** Number of Ingress Classes in the cluster. - **IngressAnnotations** List of Ingress annotations managed by NGINX Ingress Controller - **AccessControlPolicies** Number of AccessControl policies. diff --git a/internal/telemetry/data.avdl b/internal/telemetry/data.avdl index d91f89e043..4f1683370e 100644 --- a/internal/telemetry/data.avdl +++ b/internal/telemetry/data.avdl @@ -54,13 +54,13 @@ It is the UID of the `kube-system` Namespace. */ /** RegularIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ long? RegularIngressCount = null; - /** MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + /** MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ long? MasterIngressCount = null; - /** IngressClasses is the number of Ingress Classes. */ + /** MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ long? MinionIngressCount = null; - /** MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + /** IngressClasses is the number of Ingress Classes. */ long? IngressClasses = null; /** AccessControlPolicies is the number of AccessControl policies managed by NGINX Ingress Controller */ diff --git a/internal/telemetry/exporter.go b/internal/telemetry/exporter.go index f56c76e84c..16067c527a 100644 --- a/internal/telemetry/exporter.go +++ b/internal/telemetry/exporter.go @@ -77,13 +77,13 @@ type NICResourceCounts struct { Secrets int64 // Services is the number of services referenced by NGINX Ingress Controller in the cluster Services int64 - // RegularIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. + // RegularIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. RegularIngressCount int64 - // MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. + // MasterIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. MasterIngressCount int64 - // IngressClasses is the number of Ingress Classes. + // MinionIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. MinionIngressCount int64 - // MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. + // IngressClasses is the number of Ingress Classes. IngressClasses int64 // AccessControlPolicies is the number of AccessControl policies managed by NGINX Ingress Controller AccessControlPolicies int64 From 241645814aeebe645ddc636fb112baf33749b3bd Mon Sep 17 00:00:00 2001 From: Alex Fenlon Date: Thu, 23 May 2024 16:30:30 +0100 Subject: [PATCH 11/11] Fix data.avdl --- internal/telemetry/data.avdl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/telemetry/data.avdl b/internal/telemetry/data.avdl index 4f1683370e..4b96dfe9de 100644 --- a/internal/telemetry/data.avdl +++ b/internal/telemetry/data.avdl @@ -51,13 +51,13 @@ It is the UID of the `kube-system` Namespace. */ /** Services is the number of services referenced by NGINX Ingress Controller in the cluster */ long? Services = null; - /** RegularIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + /** RegularIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. */ long? RegularIngressCount = null; - /** MasterIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + /** MasterIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. */ long? MasterIngressCount = null; - /** MinionIngressCount is the number of Regular Ingress resources managed by the NGINX Ingress Controller. */ + /** MinionIngressCount is the number of Regular Ingress resources managed by NGINX Ingress Controller. */ long? MinionIngressCount = null; /** IngressClasses is the number of Ingress Classes. */