diff --git a/CHANGELOG.md b/CHANGELOG.md index c22171744231..ece40b6bca1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - `datadogexporter`: Replace HistogramMode defined as string with enum. - `pkg/translator/signalfx`: Change signalfx translator to expose To/From translator structs. (#9740) - `transformprocessor`: Add parameter validation to `truncate_all` and `limit` functions. The `limit` parameter can no longer be negative. (#9783) +- `k8sclusterreceiver`: Removing `ClusterName` as per https://github.com/kubernetes/apimachinery/commit/430b920312ca0fa10eca95967764ff08f34083a3 (#9885) ### 🚩 Deprecations 🚩 @@ -51,6 +52,7 @@ - `tanzuobservabilityexporter`: Make metrics stanza in config be optional (#9098) - `filelogreceiver`: Update Kubernetes examples to fix native OTel logs collection issue where 0 length logs cause errors (#9754) - `logstransformprocessor`: Resolve node ordering to fix intermittent failures (#9761) +- `awsinsightreceiver`: Migrate from `ConfigMapsResourceLock` to `ConfigMapsLeasesResourceLock` as per https://github.com/kubernetes/client-go/commit/276ea3ed979947d7cdd4b3d708862245ddcd8883 (#9885) ## v0.50.0 diff --git a/processor/k8sattributesprocessor/internal/kube/client.go b/processor/k8sattributesprocessor/internal/kube/client.go index cf924f30e033..8607722c8a48 100644 --- a/processor/k8sattributesprocessor/internal/kube/client.go +++ b/processor/k8sattributesprocessor/internal/kube/client.go @@ -303,13 +303,6 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) map[string]string { tags[tagNodeName] = pod.Spec.NodeName } - if c.Rules.Cluster { - clusterName := pod.GetClusterName() - if clusterName != "" { - tags[conventions.AttributeK8SClusterName] = clusterName - } - } - for _, r := range c.Rules.Labels { r.extractFromPodMetadata(pod.Labels, tags, "k8s.pod.labels.%s") } diff --git a/processor/k8sattributesprocessor/internal/kube/fake_informer.go b/processor/k8sattributesprocessor/internal/kube/fake_informer.go index 1f1c20f6aedb..ba05d4606f7c 100644 --- a/processor/k8sattributesprocessor/internal/kube/fake_informer.go +++ b/processor/k8sattributesprocessor/internal/kube/fake_informer.go @@ -51,6 +51,10 @@ func (f *FakeInformer) AddEventHandler(handler cache.ResourceEventHandler) {} func (f *FakeInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, period time.Duration) { } +func (f *FakeInformer) SetTransform(handler cache.TransformFunc) error { + return nil +} + func (f *FakeInformer) GetStore() cache.Store { return cache.NewStore(func(obj interface{}) (string, error) { return "", nil }) } @@ -131,6 +135,10 @@ func (f *NoOpInformer) AddEventHandler(handler cache.ResourceEventHandler) {} func (f *NoOpInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, period time.Duration) { } +func (f *NoOpInformer) SetTransform(handler cache.TransformFunc) error { + return nil +} + func (f *NoOpInformer) GetStore() cache.Store { return cache.NewStore(func(obj interface{}) (string, error) { return "", nil }) } diff --git a/receiver/awscontainerinsightreceiver/internal/k8sapiserver/k8sapiserver.go b/receiver/awscontainerinsightreceiver/internal/k8sapiserver/k8sapiserver.go index 9ffa7cf86fcc..70b091ba4371 100644 --- a/receiver/awscontainerinsightreceiver/internal/k8sapiserver/k8sapiserver.go +++ b/receiver/awscontainerinsightreceiver/internal/k8sapiserver/k8sapiserver.go @@ -230,7 +230,7 @@ func (k *K8sAPIServer) init() error { } lock, err := resourcelock.New( - resourcelock.ConfigMapsResourceLock, + resourcelock.ConfigMapsLeasesResourceLock, lockNamespace, lockName, clientSet.CoreV1(), clientSet.CoordinationV1(), diff --git a/receiver/k8sclusterreceiver/internal/collection/clusteresourcequotas.go b/receiver/k8sclusterreceiver/internal/collection/clusteresourcequotas.go index 20b4b461baa8..ebfc0aec4204 100644 --- a/receiver/k8sclusterreceiver/internal/collection/clusteresourcequotas.go +++ b/receiver/k8sclusterreceiver/internal/collection/clusteresourcequotas.go @@ -116,9 +116,8 @@ func getResourceForClusterResourceQuota(rq *quotav1.ClusterResourceQuota) *resou return &resourcepb.Resource{ Type: k8sType, Labels: map[string]string{ - k8sKeyClusterResourceQuotaUID: string(rq.UID), - k8sKeyClusterResourceQuotaName: rq.Name, - conventions.AttributeK8SClusterName: rq.ClusterName, + k8sKeyClusterResourceQuotaUID: string(rq.UID), + k8sKeyClusterResourceQuotaName: rq.Name, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/clusterresourcequotas_test.go b/receiver/k8sclusterreceiver/internal/collection/clusterresourcequotas_test.go index fa6588ef2708..06f3e8dc491a 100644 --- a/receiver/k8sclusterreceiver/internal/collection/clusterresourcequotas_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/clusterresourcequotas_test.go @@ -105,9 +105,8 @@ func TestClusterRequestQuotaMetrics(t *testing.T) { func newMockClusterResourceQuota(id string) *quotav1.ClusterResourceQuota { return "av1.ClusterResourceQuota{ ObjectMeta: v1.ObjectMeta{ - Name: "test-clusterquota-" + id, - UID: types.UID("test-clusterquota-" + id + "-uid"), - ClusterName: "test-openshift-cluster", + Name: "test-clusterquota-" + id, + UID: types.UID("test-clusterquota-" + id + "-uid"), }, Status: quotav1.ClusterResourceQuotaStatus{ Total: corev1.ResourceQuotaStatus{ diff --git a/receiver/k8sclusterreceiver/internal/collection/collector_test.go b/receiver/k8sclusterreceiver/internal/collection/collector_test.go index fa4f8c0f2618..1cedf7d5467b 100644 --- a/receiver/k8sclusterreceiver/internal/collection/collector_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/collector_test.go @@ -252,10 +252,9 @@ func TestDataCollectorSyncMetadata(t *testing.T) { metadataStore: &metadataStore{}, resource: &corev1.ReplicationController{ ObjectMeta: v1.ObjectMeta{ - Name: "test-replicationcontroller-1", - Namespace: "test-namespace", - UID: types.UID("test-replicationcontroller-1-uid"), - ClusterName: "test-cluster", + Name: "test-replicationcontroller-1", + Namespace: "test-namespace", + UID: types.UID("test-replicationcontroller-1-uid"), }, }, want: map[metadata.ResourceID]*KubernetesMetadata{ diff --git a/receiver/k8sclusterreceiver/internal/collection/cronjobs.go b/receiver/k8sclusterreceiver/internal/collection/cronjobs.go index ea045d8ecda2..aca7d0e463dc 100644 --- a/receiver/k8sclusterreceiver/internal/collection/cronjobs.go +++ b/receiver/k8sclusterreceiver/internal/collection/cronjobs.go @@ -83,7 +83,6 @@ func getResourceForCronJob(cj *batchv1.CronJob) *resourcepb.Resource { conventions.AttributeK8SCronJobUID: string(cj.UID), conventions.AttributeK8SCronJobName: cj.Name, conventions.AttributeK8SNamespaceName: cj.Namespace, - conventions.AttributeK8SClusterName: cj.ClusterName, }, } } @@ -95,7 +94,6 @@ func getResourceForCronJobBeta(cj *batchv1beta1.CronJob) *resourcepb.Resource { conventions.AttributeK8SCronJobUID: string(cj.UID), conventions.AttributeK8SCronJobName: cj.Name, conventions.AttributeK8SNamespaceName: cj.Namespace, - conventions.AttributeK8SClusterName: cj.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/cronjobs_test.go b/receiver/k8sclusterreceiver/internal/collection/cronjobs_test.go index d4d89f9465c3..daf5e5682a20 100644 --- a/receiver/k8sclusterreceiver/internal/collection/cronjobs_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/cronjobs_test.go @@ -77,10 +77,9 @@ func TestCronJobMetadata(t *testing.T) { func newCronJob(id string) *batchv1.CronJob { return &batchv1.CronJob{ ObjectMeta: v1.ObjectMeta{ - Name: "test-cronjob-" + id, - Namespace: "test-namespace", - UID: types.UID("test-cronjob-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-cronjob-" + id, + Namespace: "test-namespace", + UID: types.UID("test-cronjob-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/daemonsets.go b/receiver/k8sclusterreceiver/internal/collection/daemonsets.go index 5d70dee62e78..60c7beb9e47a 100644 --- a/receiver/k8sclusterreceiver/internal/collection/daemonsets.go +++ b/receiver/k8sclusterreceiver/internal/collection/daemonsets.go @@ -95,7 +95,6 @@ func getResourceForDaemonSet(ds *appsv1.DaemonSet) *resourcepb.Resource { conventions.AttributeK8SDaemonSetUID: string(ds.UID), conventions.AttributeK8SDaemonSetName: ds.Name, conventions.AttributeK8SNamespaceName: ds.Namespace, - conventions.AttributeK8SClusterName: ds.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/daemonsets_test.go b/receiver/k8sclusterreceiver/internal/collection/daemonsets_test.go index f75032004640..615214aabf44 100644 --- a/receiver/k8sclusterreceiver/internal/collection/daemonsets_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/daemonsets_test.go @@ -60,10 +60,9 @@ func TestDaemonsetMetrics(t *testing.T) { func newDaemonset(id string) *appsv1.DaemonSet { return &appsv1.DaemonSet{ ObjectMeta: v1.ObjectMeta{ - Name: "test-daemonset-" + id, - Namespace: "test-namespace", - UID: types.UID("test-daemonset-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-daemonset-" + id, + Namespace: "test-namespace", + UID: types.UID("test-daemonset-" + id + "-uid"), }, Status: appsv1.DaemonSetStatus{ CurrentNumberScheduled: 3, diff --git a/receiver/k8sclusterreceiver/internal/collection/deployments.go b/receiver/k8sclusterreceiver/internal/collection/deployments.go index 272d90f3dd00..228476cc29d9 100644 --- a/receiver/k8sclusterreceiver/internal/collection/deployments.go +++ b/receiver/k8sclusterreceiver/internal/collection/deployments.go @@ -46,7 +46,6 @@ func getResourceForDeployment(dep *appsv1.Deployment) *resourcepb.Resource { conventions.AttributeK8SDeploymentUID: string(dep.UID), conventions.AttributeK8SDeploymentName: dep.Name, conventions.AttributeK8SNamespaceName: dep.Namespace, - conventions.AttributeK8SClusterName: dep.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/deployments_test.go b/receiver/k8sclusterreceiver/internal/collection/deployments_test.go index cca72b2816c7..40cdd93ddbc2 100644 --- a/receiver/k8sclusterreceiver/internal/collection/deployments_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/deployments_test.go @@ -55,10 +55,9 @@ func newDeployment(id string) *appsv1.Deployment { desired := int32(10) return &appsv1.Deployment{ ObjectMeta: v1.ObjectMeta{ - Name: "test-deployment-" + id, - Namespace: "test-namespace", - UID: types.UID("test-deployment-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-deployment-" + id, + Namespace: "test-namespace", + UID: types.UID("test-deployment-" + id + "-uid"), }, Spec: appsv1.DeploymentSpec{ Replicas: &desired, diff --git a/receiver/k8sclusterreceiver/internal/collection/hpa.go b/receiver/k8sclusterreceiver/internal/collection/hpa.go index 378b91017fb5..efcd18056531 100644 --- a/receiver/k8sclusterreceiver/internal/collection/hpa.go +++ b/receiver/k8sclusterreceiver/internal/collection/hpa.go @@ -95,7 +95,6 @@ func getResourceForHPA(hpa *autoscalingv2beta2.HorizontalPodAutoscaler) *resourc k8sKeyHPAUID: string(hpa.UID), k8sKeyHPAName: hpa.Name, conventions.AttributeK8SNamespaceName: hpa.Namespace, - conventions.AttributeK8SClusterName: hpa.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/hpa_test.go b/receiver/k8sclusterreceiver/internal/collection/hpa_test.go index 988b148a60f9..be243437c7f8 100644 --- a/receiver/k8sclusterreceiver/internal/collection/hpa_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/hpa_test.go @@ -61,10 +61,9 @@ func newHPA(id string) *autoscalingv2beta2.HorizontalPodAutoscaler { minReplicas := int32(2) return &autoscalingv2beta2.HorizontalPodAutoscaler{ ObjectMeta: v1.ObjectMeta{ - Name: "test-hpa-" + id, - Namespace: "test-namespace", - UID: types.UID("test-hpa-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-hpa-" + id, + Namespace: "test-namespace", + UID: types.UID("test-hpa-" + id + "-uid"), }, Status: autoscalingv2beta2.HorizontalPodAutoscalerStatus{ CurrentReplicas: 5, diff --git a/receiver/k8sclusterreceiver/internal/collection/jobs.go b/receiver/k8sclusterreceiver/internal/collection/jobs.go index ce2b23f1c81e..6453be127467 100644 --- a/receiver/k8sclusterreceiver/internal/collection/jobs.go +++ b/receiver/k8sclusterreceiver/internal/collection/jobs.go @@ -113,7 +113,6 @@ func getResourceForJob(j *batchv1.Job) *resourcepb.Resource { conventions.AttributeK8SJobUID: string(j.UID), conventions.AttributeK8SJobName: j.Name, conventions.AttributeK8SNamespaceName: j.Namespace, - conventions.AttributeK8SClusterName: j.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/jobs_test.go b/receiver/k8sclusterreceiver/internal/collection/jobs_test.go index 0cb3decfb2f5..4a9e86df7d8a 100644 --- a/receiver/k8sclusterreceiver/internal/collection/jobs_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/jobs_test.go @@ -80,10 +80,9 @@ func newJob(id string) *batchv1.Job { c := int32(10) return &batchv1.Job{ ObjectMeta: v1.ObjectMeta{ - Name: "test-job-" + id, - Namespace: "test-namespace", - UID: types.UID("test-job-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-job-" + id, + Namespace: "test-namespace", + UID: types.UID("test-job-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/namespaces.go b/receiver/k8sclusterreceiver/internal/collection/namespaces.go index 294056518fd1..05fbbe7ef246 100644 --- a/receiver/k8sclusterreceiver/internal/collection/namespaces.go +++ b/receiver/k8sclusterreceiver/internal/collection/namespaces.go @@ -51,7 +51,6 @@ func getResourceForNamespace(ns *corev1.Namespace) *resourcepb.Resource { Labels: map[string]string{ k8sKeyNamespaceUID: string(ns.UID), conventions.AttributeK8SNamespaceName: ns.Namespace, - conventions.AttributeK8SClusterName: ns.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/namespaces_test.go b/receiver/k8sclusterreceiver/internal/collection/namespaces_test.go index 9a150e7e575b..bd1556901177 100644 --- a/receiver/k8sclusterreceiver/internal/collection/namespaces_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/namespaces_test.go @@ -49,10 +49,9 @@ func TestNamespaceMetrics(t *testing.T) { func newNamespace(id string) *corev1.Namespace { return &corev1.Namespace{ ObjectMeta: v1.ObjectMeta{ - Name: "test-namespace-" + id, - Namespace: "test-namespace", - UID: types.UID("test-namespace-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-namespace-" + id, + Namespace: "test-namespace", + UID: types.UID("test-namespace-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/nodes.go b/receiver/k8sclusterreceiver/internal/collection/nodes.go index 818b2d6dd188..76918b01c7eb 100644 --- a/receiver/k8sclusterreceiver/internal/collection/nodes.go +++ b/receiver/k8sclusterreceiver/internal/collection/nodes.go @@ -124,9 +124,8 @@ func getResourceForNode(node *corev1.Node) *resourcepb.Resource { return &resourcepb.Resource{ Type: k8sType, Labels: map[string]string{ - conventions.AttributeK8SNodeUID: string(node.UID), - conventions.AttributeK8SNodeName: node.Name, - conventions.AttributeK8SClusterName: node.ClusterName, + conventions.AttributeK8SNodeUID: string(node.UID), + conventions.AttributeK8SNodeName: node.Name, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/nodes_test.go b/receiver/k8sclusterreceiver/internal/collection/nodes_test.go index cb4aefbde88f..dba11fc0f75e 100644 --- a/receiver/k8sclusterreceiver/internal/collection/nodes_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/nodes_test.go @@ -101,9 +101,8 @@ func newNode(id string) *corev1.Node { if featuregate.GetRegistry().IsEnabled(reportCPUMetricsAsDoubleFeatureGateID) { return &corev1.Node{ ObjectMeta: v1.ObjectMeta{ - Name: "test-node-" + id, - UID: types.UID("test-node-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-node-" + id, + UID: types.UID("test-node-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", @@ -130,9 +129,8 @@ func newNode(id string) *corev1.Node { } return &corev1.Node{ ObjectMeta: v1.ObjectMeta{ - Name: "test-node-" + id, - UID: types.UID("test-node-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-node-" + id, + UID: types.UID("test-node-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/pods.go b/receiver/k8sclusterreceiver/internal/collection/pods.go index 167d44b6de09..d4ce72a3e419 100644 --- a/receiver/k8sclusterreceiver/internal/collection/pods.go +++ b/receiver/k8sclusterreceiver/internal/collection/pods.go @@ -118,7 +118,6 @@ func getResourceForPod(pod *corev1.Pod) *resourcepb.Resource { conventions.AttributeK8SPodName: pod.Name, conventions.AttributeK8SNodeName: pod.Spec.NodeName, conventions.AttributeK8SNamespaceName: pod.Namespace, - conventions.AttributeK8SClusterName: pod.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/pods_test.go b/receiver/k8sclusterreceiver/internal/collection/pods_test.go index 593072837076..6ca598f9f664 100644 --- a/receiver/k8sclusterreceiver/internal/collection/pods_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/pods_test.go @@ -162,10 +162,9 @@ func TestPodAndContainerMetricsReportCPUMetricsAsDouble(t *testing.T) { func newPodWithContainer(id string, spec *corev1.PodSpec, status *corev1.PodStatus) *corev1.Pod { return &corev1.Pod{ ObjectMeta: v1.ObjectMeta{ - Name: "test-pod-" + id, - Namespace: "test-namespace", - UID: types.UID("test-pod-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-pod-" + id, + Namespace: "test-namespace", + UID: types.UID("test-pod-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/replicasets.go b/receiver/k8sclusterreceiver/internal/collection/replicasets.go index e3de53c9d072..91b6f55557f2 100644 --- a/receiver/k8sclusterreceiver/internal/collection/replicasets.go +++ b/receiver/k8sclusterreceiver/internal/collection/replicasets.go @@ -47,7 +47,6 @@ func getResourceForReplicaSet(rs *appsv1.ReplicaSet) *resourcepb.Resource { conventions.AttributeK8SReplicaSetUID: string(rs.UID), conventions.AttributeK8SReplicaSetName: rs.Name, conventions.AttributeK8SNamespaceName: rs.Namespace, - conventions.AttributeK8SClusterName: rs.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/replicasets_test.go b/receiver/k8sclusterreceiver/internal/collection/replicasets_test.go index d1685bd38662..194f2180bafb 100644 --- a/receiver/k8sclusterreceiver/internal/collection/replicasets_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/replicasets_test.go @@ -54,10 +54,9 @@ func TestReplicasetMetrics(t *testing.T) { func newReplicaSet(id string) *appsv1.ReplicaSet { return &appsv1.ReplicaSet{ ObjectMeta: v1.ObjectMeta{ - Name: "test-replicaset-" + id, - Namespace: "test-namespace", - UID: types.UID("test-replicaset-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-replicaset-" + id, + Namespace: "test-namespace", + UID: types.UID("test-replicaset-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/replicationcontrollers.go b/receiver/k8sclusterreceiver/internal/collection/replicationcontrollers.go index edff68731706..340770a29a2a 100644 --- a/receiver/k8sclusterreceiver/internal/collection/replicationcontrollers.go +++ b/receiver/k8sclusterreceiver/internal/collection/replicationcontrollers.go @@ -47,7 +47,6 @@ func getResourceForReplicationController(rc *corev1.ReplicationController) *reso k8sKeyReplicationControllerUID: string(rc.UID), k8sKeyReplicationControllerName: rc.Name, conventions.AttributeK8SNamespaceName: rc.Namespace, - conventions.AttributeK8SClusterName: rc.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/resourcequotas.go b/receiver/k8sclusterreceiver/internal/collection/resourcequotas.go index bdfa773d9419..ff0f2180989c 100644 --- a/receiver/k8sclusterreceiver/internal/collection/resourcequotas.go +++ b/receiver/k8sclusterreceiver/internal/collection/resourcequotas.go @@ -94,7 +94,6 @@ func getResourceForResourceQuota(rq *corev1.ResourceQuota) *resourcepb.Resource k8sKeyResourceQuotaUID: string(rq.UID), k8sKeyResourceQuotaName: rq.Name, conventions.AttributeK8SNamespaceName: rq.Namespace, - conventions.AttributeK8SClusterName: rq.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/resourcequotas_test.go b/receiver/k8sclusterreceiver/internal/collection/resourcequotas_test.go index 84d8dcf912c0..e637db506a41 100644 --- a/receiver/k8sclusterreceiver/internal/collection/resourcequotas_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/resourcequotas_test.go @@ -54,10 +54,9 @@ func TestRequestQuotaMetrics(t *testing.T) { func newResourceQuota(id string) *corev1.ResourceQuota { return &corev1.ResourceQuota{ ObjectMeta: v1.ObjectMeta{ - Name: "test-resourcequota-" + id, - UID: types.UID("test-resourcequota-" + id + "-uid"), - ClusterName: "test-cluster", - Namespace: "test-namespace", + Name: "test-resourcequota-" + id, + UID: types.UID("test-resourcequota-" + id + "-uid"), + Namespace: "test-namespace", Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8sclusterreceiver/internal/collection/statefulsets.go b/receiver/k8sclusterreceiver/internal/collection/statefulsets.go index 01efecda7936..0e77edce421d 100644 --- a/receiver/k8sclusterreceiver/internal/collection/statefulsets.go +++ b/receiver/k8sclusterreceiver/internal/collection/statefulsets.go @@ -105,7 +105,6 @@ func getResourceForStatefulSet(ss *appsv1.StatefulSet) *resourcepb.Resource { conventions.AttributeK8SStatefulSetUID: string(ss.UID), conventions.AttributeK8SStatefulSetName: ss.Name, conventions.AttributeK8SNamespaceName: ss.Namespace, - conventions.AttributeK8SClusterName: ss.ClusterName, }, } } diff --git a/receiver/k8sclusterreceiver/internal/collection/statefulsets_test.go b/receiver/k8sclusterreceiver/internal/collection/statefulsets_test.go index a100e2404ed2..b7bf40dd76a3 100644 --- a/receiver/k8sclusterreceiver/internal/collection/statefulsets_test.go +++ b/receiver/k8sclusterreceiver/internal/collection/statefulsets_test.go @@ -86,10 +86,9 @@ func newStatefulset(id string) *appsv1.StatefulSet { desired := int32(10) return &appsv1.StatefulSet{ ObjectMeta: v1.ObjectMeta{ - Name: "test-statefulset-" + id, - Namespace: "test-namespace", - UID: types.UID("test-statefulset-" + id + "-uid"), - ClusterName: "test-cluster", + Name: "test-statefulset-" + id, + Namespace: "test-namespace", + UID: types.UID("test-statefulset-" + id + "-uid"), Labels: map[string]string{ "foo": "bar", "foo1": "", diff --git a/receiver/k8seventsreceiver/k8s_event_to_logdata.go b/receiver/k8seventsreceiver/k8s_event_to_logdata.go index f17759817964..2209c4fcc0cb 100644 --- a/receiver/k8seventsreceiver/k8s_event_to_logdata.go +++ b/receiver/k8seventsreceiver/k8s_event_to_logdata.go @@ -49,7 +49,6 @@ func k8sEventToLogData(logger *zap.Logger, ev *corev1.Event) plog.Logs { resourceAttrs := rl.Resource().Attributes() resourceAttrs.EnsureCapacity(totalResourceAttributes) - resourceAttrs.InsertString(semconv.AttributeK8SClusterName, ev.ObjectMeta.ClusterName) resourceAttrs.InsertString(semconv.AttributeK8SNodeName, ev.Source.Host) // Attributes related to the object causing the event.