From 623c4711b498623ebb1e9dee4ec784fac7ed5c2c Mon Sep 17 00:00:00 2001 From: Tina Usova Date: Wed, 3 Dec 2025 18:51:21 +0000 Subject: [PATCH 1/2] Add telemetry for ProxySettingsPolicy --- internal/controller/telemetry/collector.go | 63 +++++++++++++------ .../controller/telemetry/collector_test.go | 36 +++++++++++ internal/controller/telemetry/data.avdl | 8 +++ internal/controller/telemetry/data_test.go | 6 ++ .../ngfresourcecounts_attributes_generated.go | 2 + tests/suite/telemetry_test.go | 2 + 6 files changed, 97 insertions(+), 20 deletions(-) diff --git a/internal/controller/telemetry/collector.go b/internal/controller/telemetry/collector.go index 0369b3b740..41709f9271 100644 --- a/internal/controller/telemetry/collector.go +++ b/internal/controller/telemetry/collector.go @@ -110,6 +110,48 @@ type NGFResourceCounts struct { UpstreamSettingsPolicyCount int64 // GatewayAttachedNpCount is the total number of NginxProxy resources that are attached to a Gateway. GatewayAttachedNpCount int64 + // GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies + // attached at the Gateway level. + GatewayAttachedProxySettingsPolicyCount int64 + // RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies + // attached at the Route level. + RouteAttachedProxySettingsPolicyCount int64 +} + +func (rc *NGFResourceCounts) CountPolicies(g *graph.Graph) { + rc.BackendTLSPolicyCount = int64(len(g.BackendTLSPolicies)) + + for policyKey, policy := range g.NGFPolicies { + switch policyKey.GVK.Kind { + case kinds.ClientSettingsPolicy: + if len(policy.TargetRefs) == 0 { + continue + } + + if policy.TargetRefs[0].Kind == kinds.Gateway { + rc.GatewayAttachedClientSettingsPolicyCount++ + } else { + rc.RouteAttachedClientSettingsPolicyCount++ + } + case kinds.ObservabilityPolicy: + rc.ObservabilityPolicyCount++ + case kinds.UpstreamSettingsPolicy: + rc.UpstreamSettingsPolicyCount++ + case kinds.ProxySettingsPolicy: + if len(policy.TargetRefs) == 0 { + continue + } + + for _, tr := range policy.TargetRefs { + switch tr.Kind { + case kinds.Gateway: + rc.GatewayAttachedProxySettingsPolicyCount++ + case kinds.HTTPRoute, kinds.GRPCRoute: + rc.RouteAttachedProxySettingsPolicyCount++ + } + } + } + } } // DataCollectorConfig holds configuration parameters for DataCollectorImpl. @@ -244,26 +286,7 @@ func collectGraphResourceCount( } } - ngfResourceCounts.BackendTLSPolicyCount = int64(len(g.BackendTLSPolicies)) - - for policyKey, policy := range g.NGFPolicies { - switch policyKey.GVK.Kind { - case kinds.ClientSettingsPolicy: - if len(policy.TargetRefs) == 0 { - continue - } - - if policy.TargetRefs[0].Kind == kinds.Gateway { - ngfResourceCounts.GatewayAttachedClientSettingsPolicyCount++ - } else { - ngfResourceCounts.RouteAttachedClientSettingsPolicyCount++ - } - case kinds.ObservabilityPolicy: - ngfResourceCounts.ObservabilityPolicyCount++ - case kinds.UpstreamSettingsPolicy: - ngfResourceCounts.UpstreamSettingsPolicyCount++ - } - } + ngfResourceCounts.CountPolicies(g) ngfResourceCounts.NginxProxyCount = int64(len(g.ReferencedNginxProxies)) ngfResourceCounts.SnippetsFilterCount = int64(len(g.SnippetsFilters)) diff --git a/internal/controller/telemetry/collector_test.go b/internal/controller/telemetry/collector_test.go index 2316d9414e..f9d41e240f 100644 --- a/internal/controller/telemetry/collector_test.go +++ b/internal/controller/telemetry/collector_test.go @@ -384,6 +384,22 @@ var _ = Describe("Collector", Ordered, func() { NsName: types.NamespacedName{Namespace: "test", Name: "UpstreamSettingsPolicy-1"}, GVK: schema.GroupVersionKind{Kind: kinds.UpstreamSettingsPolicy}, }: {}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-1"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.Gateway}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-2"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.HTTPRoute}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-3"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.GRPCRoute}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-4"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.Gateway}, {Kind: kinds.HTTPRoute}, {Kind: kinds.GRPCRoute}}}, }, ReferencedNginxProxies: map[types.NamespacedName]*graph.NginxProxy{ {Namespace: "test", Name: "NginxProxy-1"}: &gcNP, @@ -494,6 +510,8 @@ var _ = Describe("Collector", Ordered, func() { SnippetsFilterCount: 3, UpstreamSettingsPolicyCount: 1, GatewayAttachedNpCount: 2, + GatewayAttachedProxySettingsPolicyCount: 2, + RouteAttachedProxySettingsPolicyCount: 4, } expData.ClusterVersion = "1.29.2" expData.ClusterPlatform = "kind" @@ -700,6 +718,22 @@ var _ = Describe("Collector", Ordered, func() { NsName: types.NamespacedName{Namespace: "test", Name: "UpstreamSettingsPolicy-1"}, GVK: schema.GroupVersionKind{Kind: kinds.UpstreamSettingsPolicy}, }: {}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-1"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.Gateway}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-2"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.HTTPRoute}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-plural"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {TargetRefs: []graph.PolicyTargetRef{{Kind: kinds.Gateway}, {Kind: kinds.HTTPRoute}, {Kind: kinds.GRPCRoute}}}, + { + NsName: types.NamespacedName{Namespace: "test", Name: "ProxySettingsPolicy-empty"}, + GVK: schema.GroupVersionKind{Kind: kinds.ProxySettingsPolicy}, + }: {}, }, ReferencedNginxProxies: map[types.NamespacedName]*graph.NginxProxy{ {Namespace: "test", Name: "NginxProxy-1"}: {Valid: true}, @@ -794,6 +828,8 @@ var _ = Describe("Collector", Ordered, func() { UpstreamSettingsPolicyCount: 1, GatewayAttachedNpCount: 1, BackendTLSPolicyCount: 1, + GatewayAttachedProxySettingsPolicyCount: 2, + RouteAttachedProxySettingsPolicyCount: 3, } expData.NginxPodCount = 1 expData.InferencePoolCount = 1 diff --git a/internal/controller/telemetry/data.avdl b/internal/controller/telemetry/data.avdl index 9b56755400..e3509835ba 100644 --- a/internal/controller/telemetry/data.avdl +++ b/internal/controller/telemetry/data.avdl @@ -105,6 +105,14 @@ attached at the Gateway level. */ /** GatewayAttachedNpCount is the total number of NginxProxy resources that are attached to a Gateway. */ long? GatewayAttachedNpCount = null; + /** GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies +attached at the Gateway level. */ + long? GatewayAttachedProxySettingsPolicyCount = null; + + /** RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies +attached at the Route level. */ + long? RouteAttachedProxySettingsPolicyCount = null; + /** NginxPodCount is the total number of Nginx data plane Pods. */ long? NginxPodCount = null; diff --git a/internal/controller/telemetry/data_test.go b/internal/controller/telemetry/data_test.go index f6dbcfc333..6c1b1019f2 100644 --- a/internal/controller/telemetry/data_test.go +++ b/internal/controller/telemetry/data_test.go @@ -41,6 +41,8 @@ func TestDataAttributes(t *testing.T) { SnippetsFilterCount: 13, UpstreamSettingsPolicyCount: 14, GatewayAttachedNpCount: 15, + GatewayAttachedProxySettingsPolicyCount: 17, + RouteAttachedProxySettingsPolicyCount: 18, }, SnippetsFiltersDirectives: []string{"main-three-count", "http-two-count", "server-one-count"}, SnippetsFiltersDirectivesCount: []int64{3, 2, 1}, @@ -84,6 +86,8 @@ func TestDataAttributes(t *testing.T) { attribute.Int64("SnippetsFilterCount", 13), attribute.Int64("UpstreamSettingsPolicyCount", 14), attribute.Int64("GatewayAttachedNpCount", 15), + attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 17), + attribute.Int64("RouteAttachedProxySettingsPolicyCount", 18), attribute.Int64("NginxPodCount", 3), attribute.Int64("ControlPlanePodCount", 3), attribute.Bool("NginxOneConnectionEnabled", true), @@ -132,6 +136,8 @@ func TestDataAttributesWithEmptyData(t *testing.T) { attribute.Int64("SnippetsFilterCount", 0), attribute.Int64("UpstreamSettingsPolicyCount", 0), attribute.Int64("GatewayAttachedNpCount", 0), + attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 0), + attribute.Int64("RouteAttachedProxySettingsPolicyCount", 0), attribute.Int64("NginxPodCount", 0), attribute.Int64("ControlPlanePodCount", 0), attribute.Bool("NginxOneConnectionEnabled", false), diff --git a/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go b/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go index 3073f15eb4..3cf498d027 100644 --- a/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go +++ b/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go @@ -28,6 +28,8 @@ func (d *NGFResourceCounts) Attributes() []attribute.KeyValue { attrs = append(attrs, attribute.Int64("SnippetsFilterCount", d.SnippetsFilterCount)) attrs = append(attrs, attribute.Int64("UpstreamSettingsPolicyCount", d.UpstreamSettingsPolicyCount)) attrs = append(attrs, attribute.Int64("GatewayAttachedNpCount", d.GatewayAttachedNpCount)) + attrs = append(attrs, attribute.Int64("GatewayAttachedProxySettingsPolicyCount", d.GatewayAttachedProxySettingsPolicyCount)) + attrs = append(attrs, attribute.Int64("RouteAttachedProxySettingsPolicyCount", d.RouteAttachedProxySettingsPolicyCount)) return attrs } diff --git a/tests/suite/telemetry_test.go b/tests/suite/telemetry_test.go index 51d227ed2d..91780f8c55 100644 --- a/tests/suite/telemetry_test.go +++ b/tests/suite/telemetry_test.go @@ -93,6 +93,8 @@ var _ = Describe("Telemetry test with OTel collector", Label("telemetry"), func( "SnippetsFilterCount: Int(0)", "UpstreamSettingsPolicyCount: Int(0)", "GatewayAttachedNpCount: Int(0)", + "GatewayAttachedProxySettingsPolicyCount: Int(0)", + "RouteAttachedProxySettingsPolicyCount: Int(0)", "NginxPodCount: Int(0)", "ControlPlanePodCount: Int(1)", "NginxOneConnectionEnabled: Bool(false)", From 73c60fba8fa13e2668f54940779980117e410d7f Mon Sep 17 00:00:00 2001 From: Tina Usova Date: Mon, 8 Dec 2025 15:30:18 +0000 Subject: [PATCH 2/2] Move ProxySettingsPolicies count out of NGFResourceCounts --- internal/controller/telemetry/collector.go | 54 ++++++++++++------- .../controller/telemetry/collector_test.go | 8 +-- internal/controller/telemetry/data.avdl | 16 +++--- .../telemetry/data_attributes_generated.go | 2 + internal/controller/telemetry/data_test.go | 24 ++++----- .../ngfresourcecounts_attributes_generated.go | 2 - tests/suite/telemetry_test.go | 4 +- 7 files changed, 62 insertions(+), 48 deletions(-) diff --git a/internal/controller/telemetry/collector.go b/internal/controller/telemetry/collector.go index 41709f9271..ff45dbb81a 100644 --- a/internal/controller/telemetry/collector.go +++ b/internal/controller/telemetry/collector.go @@ -71,6 +71,12 @@ type Data struct { //nolint //required to skip golangci-lint-full fieldalignment InferencePoolCount int64 // BuildOS is the base operating system the control plane was built on (e.g. alpine, ubi). BuildOS string + // GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies + // attached at the Gateway level. + GatewayAttachedProxySettingsPolicyCount int64 + // RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies + // attached at the Route level. + RouteAttachedProxySettingsPolicyCount int64 } // NGFResourceCounts stores the counts of all relevant resources that NGF processes and generates configuration from. @@ -110,12 +116,6 @@ type NGFResourceCounts struct { UpstreamSettingsPolicyCount int64 // GatewayAttachedNpCount is the total number of NginxProxy resources that are attached to a Gateway. GatewayAttachedNpCount int64 - // GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies - // attached at the Gateway level. - GatewayAttachedProxySettingsPolicyCount int64 - // RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies - // attached at the Route level. - RouteAttachedProxySettingsPolicyCount int64 } func (rc *NGFResourceCounts) CountPolicies(g *graph.Graph) { @@ -137,7 +137,16 @@ func (rc *NGFResourceCounts) CountPolicies(g *graph.Graph) { rc.ObservabilityPolicyCount++ case kinds.UpstreamSettingsPolicy: rc.UpstreamSettingsPolicyCount++ - case kinds.ProxySettingsPolicy: + } + } +} + +func CountProxySettingsPolicies(g *graph.Graph) (int64, int64) { + gatewayAttachedProxySettingsPolicyCount := int64(0) + routeAttachedProxySettingsPolicyCount := int64(0) + + for policyKey, policy := range g.NGFPolicies { + if policyKey.GVK.Kind == kinds.ProxySettingsPolicy { if len(policy.TargetRefs) == 0 { continue } @@ -145,13 +154,15 @@ func (rc *NGFResourceCounts) CountPolicies(g *graph.Graph) { for _, tr := range policy.TargetRefs { switch tr.Kind { case kinds.Gateway: - rc.GatewayAttachedProxySettingsPolicyCount++ + gatewayAttachedProxySettingsPolicyCount++ case kinds.HTTPRoute, kinds.GRPCRoute: - rc.RouteAttachedProxySettingsPolicyCount++ + routeAttachedProxySettingsPolicyCount++ } } } } + + return gatewayAttachedProxySettingsPolicyCount, routeAttachedProxySettingsPolicyCount } // DataCollectorConfig holds configuration parameters for DataCollectorImpl. @@ -228,6 +239,7 @@ func (c DataCollectorImpl) Collect(ctx context.Context) (Data, error) { buildOs = "alpine" } inferencePoolCount := int64(len(g.ReferencedInferencePools)) + gatewayAttachedProxySettingsPolicyCount, routeAttachedProxySettingsPolicyCount := CountProxySettingsPolicies(g) data := Data{ Data: tel.Data{ @@ -240,17 +252,19 @@ func (c DataCollectorImpl) Collect(ctx context.Context) (Data, error) { InstallationID: deploymentID, ClusterNodeCount: int64(clusterInfo.NodeCount), }, - NGFResourceCounts: graphResourceCount, - ImageSource: c.cfg.ImageSource, - BuildOS: buildOs, - FlagNames: c.cfg.Flags.Names, - FlagValues: c.cfg.Flags.Values, - SnippetsFiltersDirectives: snippetsFiltersDirectives, - SnippetsFiltersDirectivesCount: snippetsFiltersDirectivesCount, - NginxPodCount: nginxPodCount, - ControlPlanePodCount: int64(replicaCount), - NginxOneConnectionEnabled: c.cfg.NginxOneConsoleConnection, - InferencePoolCount: inferencePoolCount, + NGFResourceCounts: graphResourceCount, + ImageSource: c.cfg.ImageSource, + BuildOS: buildOs, + FlagNames: c.cfg.Flags.Names, + FlagValues: c.cfg.Flags.Values, + SnippetsFiltersDirectives: snippetsFiltersDirectives, + SnippetsFiltersDirectivesCount: snippetsFiltersDirectivesCount, + NginxPodCount: nginxPodCount, + ControlPlanePodCount: int64(replicaCount), + NginxOneConnectionEnabled: c.cfg.NginxOneConsoleConnection, + InferencePoolCount: inferencePoolCount, + GatewayAttachedProxySettingsPolicyCount: gatewayAttachedProxySettingsPolicyCount, + RouteAttachedProxySettingsPolicyCount: routeAttachedProxySettingsPolicyCount, } return data, nil diff --git a/internal/controller/telemetry/collector_test.go b/internal/controller/telemetry/collector_test.go index f9d41e240f..bb32fc5292 100644 --- a/internal/controller/telemetry/collector_test.go +++ b/internal/controller/telemetry/collector_test.go @@ -510,8 +510,6 @@ var _ = Describe("Collector", Ordered, func() { SnippetsFilterCount: 3, UpstreamSettingsPolicyCount: 1, GatewayAttachedNpCount: 2, - GatewayAttachedProxySettingsPolicyCount: 2, - RouteAttachedProxySettingsPolicyCount: 4, } expData.ClusterVersion = "1.29.2" expData.ClusterPlatform = "kind" @@ -547,6 +545,8 @@ var _ = Describe("Collector", Ordered, func() { expData.BuildOS = "alpine" expData.InferencePoolCount = 3 + expData.GatewayAttachedProxySettingsPolicyCount = 2 + expData.RouteAttachedProxySettingsPolicyCount = 4 data, err := dataCollector.Collect(ctx) Expect(err).ToNot(HaveOccurred()) @@ -828,11 +828,11 @@ var _ = Describe("Collector", Ordered, func() { UpstreamSettingsPolicyCount: 1, GatewayAttachedNpCount: 1, BackendTLSPolicyCount: 1, - GatewayAttachedProxySettingsPolicyCount: 2, - RouteAttachedProxySettingsPolicyCount: 3, } expData.NginxPodCount = 1 expData.InferencePoolCount = 1 + expData.GatewayAttachedProxySettingsPolicyCount = 2 + expData.RouteAttachedProxySettingsPolicyCount = 3 data, err := dataCollector.Collect(ctx) diff --git a/internal/controller/telemetry/data.avdl b/internal/controller/telemetry/data.avdl index e3509835ba..e3b2b02af3 100644 --- a/internal/controller/telemetry/data.avdl +++ b/internal/controller/telemetry/data.avdl @@ -105,14 +105,6 @@ attached at the Gateway level. */ /** GatewayAttachedNpCount is the total number of NginxProxy resources that are attached to a Gateway. */ long? GatewayAttachedNpCount = null; - /** GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies -attached at the Gateway level. */ - long? GatewayAttachedProxySettingsPolicyCount = null; - - /** RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies -attached at the Route level. */ - long? RouteAttachedProxySettingsPolicyCount = null; - /** NginxPodCount is the total number of Nginx data plane Pods. */ long? NginxPodCount = null; @@ -128,5 +120,13 @@ attached at the Route level. */ /** BuildOS is the base operating system the control plane was built on (e.g. alpine, ubi). */ string? BuildOS = null; + /** GatewayAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies +attached at the Gateway level. */ + long? GatewayAttachedProxySettingsPolicyCount = null; + + /** RouteAttachedProxySettingsPolicyCount is the number of relevant ProxySettingsPolicies +attached at the Route level. */ + long? RouteAttachedProxySettingsPolicyCount = null; + } } diff --git a/internal/controller/telemetry/data_attributes_generated.go b/internal/controller/telemetry/data_attributes_generated.go index ebc4eee057..7b82744512 100644 --- a/internal/controller/telemetry/data_attributes_generated.go +++ b/internal/controller/telemetry/data_attributes_generated.go @@ -25,6 +25,8 @@ func (d *Data) Attributes() []attribute.KeyValue { attrs = append(attrs, attribute.Bool("NginxOneConnectionEnabled", d.NginxOneConnectionEnabled)) attrs = append(attrs, attribute.Int64("InferencePoolCount", d.InferencePoolCount)) attrs = append(attrs, attribute.String("BuildOS", d.BuildOS)) + attrs = append(attrs, attribute.Int64("GatewayAttachedProxySettingsPolicyCount", d.GatewayAttachedProxySettingsPolicyCount)) + attrs = append(attrs, attribute.Int64("RouteAttachedProxySettingsPolicyCount", d.RouteAttachedProxySettingsPolicyCount)) return attrs } diff --git a/internal/controller/telemetry/data_test.go b/internal/controller/telemetry/data_test.go index 6c1b1019f2..88434a25f4 100644 --- a/internal/controller/telemetry/data_test.go +++ b/internal/controller/telemetry/data_test.go @@ -41,15 +41,15 @@ func TestDataAttributes(t *testing.T) { SnippetsFilterCount: 13, UpstreamSettingsPolicyCount: 14, GatewayAttachedNpCount: 15, - GatewayAttachedProxySettingsPolicyCount: 17, - RouteAttachedProxySettingsPolicyCount: 18, }, - SnippetsFiltersDirectives: []string{"main-three-count", "http-two-count", "server-one-count"}, - SnippetsFiltersDirectivesCount: []int64{3, 2, 1}, - NginxPodCount: 3, - ControlPlanePodCount: 3, - NginxOneConnectionEnabled: true, - InferencePoolCount: 16, + SnippetsFiltersDirectives: []string{"main-three-count", "http-two-count", "server-one-count"}, + SnippetsFiltersDirectivesCount: []int64{3, 2, 1}, + NginxPodCount: 3, + ControlPlanePodCount: 3, + NginxOneConnectionEnabled: true, + InferencePoolCount: 16, + GatewayAttachedProxySettingsPolicyCount: 17, + RouteAttachedProxySettingsPolicyCount: 18, } expected := []attribute.KeyValue{ @@ -86,13 +86,13 @@ func TestDataAttributes(t *testing.T) { attribute.Int64("SnippetsFilterCount", 13), attribute.Int64("UpstreamSettingsPolicyCount", 14), attribute.Int64("GatewayAttachedNpCount", 15), - attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 17), - attribute.Int64("RouteAttachedProxySettingsPolicyCount", 18), attribute.Int64("NginxPodCount", 3), attribute.Int64("ControlPlanePodCount", 3), attribute.Bool("NginxOneConnectionEnabled", true), attribute.Int64("InferencePoolCount", 16), attribute.String("BuildOS", ""), + attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 17), + attribute.Int64("RouteAttachedProxySettingsPolicyCount", 18), } result := data.Attributes() @@ -136,13 +136,13 @@ func TestDataAttributesWithEmptyData(t *testing.T) { attribute.Int64("SnippetsFilterCount", 0), attribute.Int64("UpstreamSettingsPolicyCount", 0), attribute.Int64("GatewayAttachedNpCount", 0), - attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 0), - attribute.Int64("RouteAttachedProxySettingsPolicyCount", 0), attribute.Int64("NginxPodCount", 0), attribute.Int64("ControlPlanePodCount", 0), attribute.Bool("NginxOneConnectionEnabled", false), attribute.Int64("InferencePoolCount", 0), attribute.String("BuildOS", ""), + attribute.Int64("GatewayAttachedProxySettingsPolicyCount", 0), + attribute.Int64("RouteAttachedProxySettingsPolicyCount", 0), } result := data.Attributes() diff --git a/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go b/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go index 3cf498d027..3073f15eb4 100644 --- a/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go +++ b/internal/controller/telemetry/ngfresourcecounts_attributes_generated.go @@ -28,8 +28,6 @@ func (d *NGFResourceCounts) Attributes() []attribute.KeyValue { attrs = append(attrs, attribute.Int64("SnippetsFilterCount", d.SnippetsFilterCount)) attrs = append(attrs, attribute.Int64("UpstreamSettingsPolicyCount", d.UpstreamSettingsPolicyCount)) attrs = append(attrs, attribute.Int64("GatewayAttachedNpCount", d.GatewayAttachedNpCount)) - attrs = append(attrs, attribute.Int64("GatewayAttachedProxySettingsPolicyCount", d.GatewayAttachedProxySettingsPolicyCount)) - attrs = append(attrs, attribute.Int64("RouteAttachedProxySettingsPolicyCount", d.RouteAttachedProxySettingsPolicyCount)) return attrs } diff --git a/tests/suite/telemetry_test.go b/tests/suite/telemetry_test.go index 91780f8c55..644576a864 100644 --- a/tests/suite/telemetry_test.go +++ b/tests/suite/telemetry_test.go @@ -93,13 +93,13 @@ var _ = Describe("Telemetry test with OTel collector", Label("telemetry"), func( "SnippetsFilterCount: Int(0)", "UpstreamSettingsPolicyCount: Int(0)", "GatewayAttachedNpCount: Int(0)", - "GatewayAttachedProxySettingsPolicyCount: Int(0)", - "RouteAttachedProxySettingsPolicyCount: Int(0)", "NginxPodCount: Int(0)", "ControlPlanePodCount: Int(1)", "NginxOneConnectionEnabled: Bool(false)", "InferencePoolCount: Int(0)", "BuildOS:", + "GatewayAttachedProxySettingsPolicyCount: Int(0)", + "RouteAttachedProxySettingsPolicyCount: Int(0)", }, ) })