From 8d7f4ade90722a2496de4fd9c3dc888866f38208 Mon Sep 17 00:00:00 2001 From: Gemene Narcis Date: Tue, 17 Sep 2024 13:36:39 +0300 Subject: [PATCH] k8sclusterreceiver: migrate to latest semconv version --- .../testdata/expected.yaml | 2 +- .../internal/container/containers.go | 2 +- .../internal/cronjob/testdata/expected.yaml | 2 +- .../internal/demonset/testdata/expected.yaml | 2 +- .../internal/deployment/deployments.go | 2 +- .../deployment/testdata/expected.yaml | 2 +- .../internal/jobs/testdata/expected.yaml | 2 +- .../jobs/testdata/expected_empty.yaml | 2 +- .../internal/metadata/generated_metrics.go | 56 +++++++++------ .../internal/namespace/testdata/expected.yaml | 2 +- .../k8sclusterreceiver/internal/node/nodes.go | 2 +- .../internal/node/testdata/expected.yaml | 2 +- .../node/testdata/expected_mdatagen.yaml | 2 +- .../node/testdata/expected_optional.yaml | 2 +- .../k8sclusterreceiver/internal/pod/pods.go | 2 +- .../internal/pod/testdata/expected.yaml | 4 +- .../pod/testdata/expected_evicted.yaml | 4 +- .../replicaset/testdata/expected.yaml | 2 +- .../testdata/expected.yaml | 2 +- .../resourcequota/testdata/expected.yaml | 2 +- receiver/k8sclusterreceiver/metadata.yaml | 2 +- .../testdata/e2e/expected.yaml | 68 +++++++++---------- 22 files changed, 92 insertions(+), 76 deletions(-) diff --git a/receiver/k8sclusterreceiver/internal/clusterresourcequota/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/clusterresourcequota/testdata/expected.yaml index 4853ca19f698..c9a777f11be6 100644 --- a/receiver/k8sclusterreceiver/internal/clusterresourcequota/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/clusterresourcequota/testdata/expected.yaml @@ -7,7 +7,7 @@ resourceMetrics: - key: openshift.clusterquota.uid value: stringValue: test-clusterquota-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The configured upper limit for a particular resource. diff --git a/receiver/k8sclusterreceiver/internal/container/containers.go b/receiver/k8sclusterreceiver/internal/container/containers.go index 368f4c73c410..129bb2d9f027 100644 --- a/receiver/k8sclusterreceiver/internal/container/containers.go +++ b/receiver/k8sclusterreceiver/internal/container/containers.go @@ -5,7 +5,7 @@ package container // import "github.com/open-telemetry/opentelemetry-collector-c import ( "go.opentelemetry.io/collector/pdata/pcommon" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" + conventions "go.opentelemetry.io/collector/semconv/v1.27.0" "go.uber.org/zap" corev1 "k8s.io/api/core/v1" diff --git a/receiver/k8sclusterreceiver/internal/cronjob/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/cronjob/testdata/expected.yaml index 04e6a9422ed8..51a3424e9ed1 100644 --- a/receiver/k8sclusterreceiver/internal/cronjob/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/cronjob/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.cronjob.uid value: stringValue: test-cronjob-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The number of actively running jobs for a cronjob diff --git a/receiver/k8sclusterreceiver/internal/demonset/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/demonset/testdata/expected.yaml index e983af4c2751..210cae49dfd6 100644 --- a/receiver/k8sclusterreceiver/internal/demonset/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/demonset/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.daemonset.uid value: stringValue: test-daemonset-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod diff --git a/receiver/k8sclusterreceiver/internal/deployment/deployments.go b/receiver/k8sclusterreceiver/internal/deployment/deployments.go index 6f3eb2463ff6..1b43f60d691c 100644 --- a/receiver/k8sclusterreceiver/internal/deployment/deployments.go +++ b/receiver/k8sclusterreceiver/internal/deployment/deployments.go @@ -5,7 +5,7 @@ package deployment // import "github.com/open-telemetry/opentelemetry-collector- import ( "go.opentelemetry.io/collector/pdata/pcommon" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" + conventions "go.opentelemetry.io/collector/semconv/v1.27.0" appsv1 "k8s.io/api/apps/v1" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata" diff --git a/receiver/k8sclusterreceiver/internal/deployment/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/deployment/testdata/expected.yaml index 48a905469352..da5c60a3e38c 100644 --- a/receiver/k8sclusterreceiver/internal/deployment/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/deployment/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: test-namespace - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Total number of available pods (ready for at least minReadySeconds) targeted by this deployment diff --git a/receiver/k8sclusterreceiver/internal/jobs/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/jobs/testdata/expected.yaml index 149e0203ef68..6c221b487d82 100644 --- a/receiver/k8sclusterreceiver/internal/jobs/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/jobs/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.job.uid value: stringValue: test-job-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The number of actively running pods for a job diff --git a/receiver/k8sclusterreceiver/internal/jobs/testdata/expected_empty.yaml b/receiver/k8sclusterreceiver/internal/jobs/testdata/expected_empty.yaml index 0fb5ef6fa536..66d88e63d58c 100644 --- a/receiver/k8sclusterreceiver/internal/jobs/testdata/expected_empty.yaml +++ b/receiver/k8sclusterreceiver/internal/jobs/testdata/expected_empty.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.job.uid value: stringValue: test-job-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The number of actively running pods for a job diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go index b9ceb55c35ac..3d6b0b2c1e98 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_metrics.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver" - conventions "go.opentelemetry.io/collector/semconv/v1.18.0" + conventions "go.opentelemetry.io/collector/semconv/v1.27.0" ) type metricK8sContainerCPULimit struct { @@ -2241,17 +2241,25 @@ type MetricsBuilder struct { metricOpenshiftClusterquotaUsed metricOpenshiftClusterquotaUsed } -// metricBuilderOption applies changes to default metrics builder. -type metricBuilderOption func(*MetricsBuilder) +// MetricBuilderOption applies changes to default metrics builder. +type MetricBuilderOption interface { + apply(*MetricsBuilder) +} + +type metricBuilderOptionFunc func(mb *MetricsBuilder) + +func (mbof metricBuilderOptionFunc) apply(mb *MetricsBuilder) { + mbof(mb) +} // WithStartTime sets startTime on the metrics builder. -func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption { - return func(mb *MetricsBuilder) { +func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption { + return metricBuilderOptionFunc(func(mb *MetricsBuilder) { mb.startTime = startTime - } + }) } -func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...metricBuilderOption) *MetricsBuilder { +func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder { mb := &MetricsBuilder{ config: mbc, startTime: pcommon.NewTimestampFromTime(time.Now()), @@ -2528,7 +2536,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, opt } for _, op := range options { - op(mb) + op.apply(mb) } return mb } @@ -2546,20 +2554,28 @@ func (mb *MetricsBuilder) updateCapacity(rm pmetric.ResourceMetrics) { } // ResourceMetricsOption applies changes to provided resource metrics. -type ResourceMetricsOption func(pmetric.ResourceMetrics) +type ResourceMetricsOption interface { + apply(pmetric.ResourceMetrics) +} + +type resourceMetricsOptionFunc func(pmetric.ResourceMetrics) + +func (rmof resourceMetricsOptionFunc) apply(rm pmetric.ResourceMetrics) { + rmof(rm) +} // WithResource sets the provided resource on the emitted ResourceMetrics. // It's recommended to use ResourceBuilder to create the resource. func WithResource(res pcommon.Resource) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { res.CopyTo(rm.Resource()) - } + }) } // WithStartTimeOverride overrides start time for all the resource metrics data points. // This option should be only used if different start time has to be set on metrics coming from different resources. func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { - return func(rm pmetric.ResourceMetrics) { + return resourceMetricsOptionFunc(func(rm pmetric.ResourceMetrics) { var dps pmetric.NumberDataPointSlice metrics := rm.ScopeMetrics().At(0).Metrics() for i := 0; i < metrics.Len(); i++ { @@ -2573,7 +2589,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { dps.At(j).SetStartTimestamp(start) } } - } + }) } // EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for @@ -2581,7 +2597,7 @@ func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption { // needs to emit metrics from several resources. Otherwise calling this function is not required, // just `Emit` function can be called instead. // Resource attributes should be provided as ResourceMetricsOption arguments. -func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { +func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption) { rm := pmetric.NewResourceMetrics() rm.SetSchemaUrl(conventions.SchemaURL) ils := rm.ScopeMetrics().AppendEmpty() @@ -2633,8 +2649,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { mb.metricOpenshiftClusterquotaLimit.emit(ils.Metrics()) mb.metricOpenshiftClusterquotaUsed.emit(ils.Metrics()) - for _, op := range rmo { - op(rm) + for _, op := range options { + op.apply(rm) } for attr, filter := range mb.resourceAttributeIncludeFilter { if val, ok := rm.Resource().Attributes().Get(attr); ok && !filter.Matches(val.AsString()) { @@ -2656,8 +2672,8 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) { // Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for // recording another set of metrics. This function will be responsible for applying all the transformations required to // produce metric representation defined in metadata and user config, e.g. delta or cumulative. -func (mb *MetricsBuilder) Emit(rmo ...ResourceMetricsOption) pmetric.Metrics { - mb.EmitForResource(rmo...) +func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics { + mb.EmitForResource(options...) metrics := mb.metricsBuffer mb.metricsBuffer = pmetric.NewMetrics() return metrics @@ -2885,9 +2901,9 @@ func (mb *MetricsBuilder) RecordOpenshiftClusterquotaUsedDataPoint(ts pcommon.Ti // Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, // and metrics builder should update its startTime and reset it's internal state accordingly. -func (mb *MetricsBuilder) Reset(options ...metricBuilderOption) { +func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption) { mb.startTime = pcommon.NewTimestampFromTime(time.Now()) for _, op := range options { - op(mb) + op.apply(mb) } } diff --git a/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml index 6f8cc1d8e03c..b7d0608f1adc 100644 --- a/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/namespace/testdata/expected.yaml @@ -7,7 +7,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: test-namespace-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) diff --git a/receiver/k8sclusterreceiver/internal/node/nodes.go b/receiver/k8sclusterreceiver/internal/node/nodes.go index f762b7e14ae3..182de98dc5c5 100644 --- a/receiver/k8sclusterreceiver/internal/node/nodes.go +++ b/receiver/k8sclusterreceiver/internal/node/nodes.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/receiver" - conventions "go.opentelemetry.io/collector/semconv/v1.18.0" + conventions "go.opentelemetry.io/collector/semconv/v1.27.0" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" diff --git a/receiver/k8sclusterreceiver/internal/node/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/node/testdata/expected.yaml index 7e63aac6f972..41add331ab56 100644 --- a/receiver/k8sclusterreceiver/internal/node/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/node/testdata/expected.yaml @@ -7,7 +7,7 @@ resourceMetrics: - key: k8s.node.uid value: stringValue: test-node-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Amount of cpu allocatable on the node diff --git a/receiver/k8sclusterreceiver/internal/node/testdata/expected_mdatagen.yaml b/receiver/k8sclusterreceiver/internal/node/testdata/expected_mdatagen.yaml index 47350ae63d5a..b595aac58e5e 100644 --- a/receiver/k8sclusterreceiver/internal/node/testdata/expected_mdatagen.yaml +++ b/receiver/k8sclusterreceiver/internal/node/testdata/expected_mdatagen.yaml @@ -7,7 +7,7 @@ resourceMetrics: - key: k8s.node.uid value: stringValue: test-node-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The condition of a particular Node. diff --git a/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml b/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml index a20d82948190..b6509383217c 100644 --- a/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml +++ b/receiver/k8sclusterreceiver/internal/node/testdata/expected_optional.yaml @@ -23,7 +23,7 @@ resourceMetrics: value: stringValue: "linux" - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Amount of cpu allocatable on the node diff --git a/receiver/k8sclusterreceiver/internal/pod/pods.go b/receiver/k8sclusterreceiver/internal/pod/pods.go index 81cf2a206789..39ca2fd4e459 100644 --- a/receiver/k8sclusterreceiver/internal/pod/pods.go +++ b/receiver/k8sclusterreceiver/internal/pod/pods.go @@ -8,7 +8,7 @@ import ( "time" "go.opentelemetry.io/collector/pdata/pcommon" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" + conventions "go.opentelemetry.io/collector/semconv/v1.27.0" "go.uber.org/zap" appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" diff --git a/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml index 50fdcb9bde22..e2f53eb55e20 100644 --- a/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/pod/testdata/expected.yaml @@ -13,7 +13,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: test-pod-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -51,7 +51,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: test-pod-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. diff --git a/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml b/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml index 58e142eb3301..1addd19240b4 100644 --- a/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml +++ b/receiver/k8sclusterreceiver/internal/pod/testdata/expected_evicted.yaml @@ -16,7 +16,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: test-pod-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -63,7 +63,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: test-pod-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. diff --git a/receiver/k8sclusterreceiver/internal/replicaset/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/replicaset/testdata/expected.yaml index 3e71aa0e5fd1..8d405db5dfb4 100644 --- a/receiver/k8sclusterreceiver/internal/replicaset/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/replicaset/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.replicaset.uid value: stringValue: test-replicaset-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Number of desired pods in this replicaset diff --git a/receiver/k8sclusterreceiver/internal/replicationcontroller/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/replicationcontroller/testdata/expected.yaml index 4c874327ec49..218136350b79 100644 --- a/receiver/k8sclusterreceiver/internal/replicationcontroller/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/replicationcontroller/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.replicationcontroller.uid value: stringValue: test-replicationcontroller-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: Total number of available pods (ready for at least minReadySeconds) targeted by this replication_controller diff --git a/receiver/k8sclusterreceiver/internal/resourcequota/testdata/expected.yaml b/receiver/k8sclusterreceiver/internal/resourcequota/testdata/expected.yaml index 79f7b0c51c54..b8ddf3de881d 100644 --- a/receiver/k8sclusterreceiver/internal/resourcequota/testdata/expected.yaml +++ b/receiver/k8sclusterreceiver/internal/resourcequota/testdata/expected.yaml @@ -10,7 +10,7 @@ resourceMetrics: - key: k8s.resourcequota.uid value: stringValue: test-resourcequota-1-uid - schemaUrl: https://opentelemetry.io/schemas/1.18.0 + schemaUrl: https://opentelemetry.io/schemas/1.27.0 scopeMetrics: - metrics: - description: The upper limit for a particular resource in a specific namespace. Will only be sent if a quota is specified. CPU requests/limits will be sent as millicores diff --git a/receiver/k8sclusterreceiver/metadata.yaml b/receiver/k8sclusterreceiver/metadata.yaml index 677ceb29a544..1ab1bba82e61 100644 --- a/receiver/k8sclusterreceiver/metadata.yaml +++ b/receiver/k8sclusterreceiver/metadata.yaml @@ -9,7 +9,7 @@ status: codeowners: active: [dmitryax, TylerHelmuth, povilasv] -sem_conv_version: 1.18.0 +sem_conv_version: 1.27.0 resource_attributes: k8s.namespace.uid: diff --git a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml index bbd6a95685b9..01b0f7790cba 100644 --- a/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml +++ b/receiver/k8sclusterreceiver/testdata/e2e/expected.yaml @@ -7,7 +7,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: 3604b135-20f2-404b-9c1a-175ef649793e - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) @@ -28,7 +28,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: 414da07d-33d0-4043-ae7c-d6b264d134e5 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) @@ -49,7 +49,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: 7516afba-1597-49e3-8569-9732b7b94865 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) @@ -70,7 +70,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: 8dd32894-d0ff-4cff-bd75-b818c20fc72b - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) @@ -91,7 +91,7 @@ resourceMetrics: - key: k8s.namespace.uid value: stringValue: caa467a2-d3e8-4e66-8b76-a155464bac79 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: The current phase of namespaces (1 for active and 0 for terminating) @@ -112,7 +112,7 @@ resourceMetrics: - key: k8s.node.uid value: stringValue: afd51338-8dbe-4234-aed3-0d1a9b3ee38e - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Ready condition status of the node (true=1, false=0, unknown=-1) @@ -136,7 +136,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: kube-system - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod @@ -181,7 +181,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: kube-system - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of nodes that are running at least 1 daemon pod and are supposed to run the daemon pod @@ -226,7 +226,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: kube-system - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this deployment @@ -257,7 +257,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: local-path-storage - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this deployment @@ -288,7 +288,7 @@ resourceMetrics: - key: k8s.namespace.name value: stringValue: default - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this deployment @@ -319,7 +319,7 @@ resourceMetrics: - key: k8s.replicaset.uid value: stringValue: fafc728a-82c7-49d6-a816-6bff81a191b4 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this replicaset @@ -350,7 +350,7 @@ resourceMetrics: - key: k8s.replicaset.uid value: stringValue: 8477bceb-33de-4072-9bb1-fbc762defdda - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this replicaset @@ -381,7 +381,7 @@ resourceMetrics: - key: k8s.replicaset.uid value: stringValue: 59e21dbf-09e1-4053-851d-90aad70bfb01 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Number of desired pods in this replicaset @@ -415,7 +415,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 5e4d1b29-35e5-4ff6-9779-b02921adcace - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -442,7 +442,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: ebd4da01-4a19-4ed8-bb2b-a75fa9c66160 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -469,7 +469,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 2c672907-5d69-4f91-85e0-f1792164cadc - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -496,7 +496,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 16463557-8966-458d-b356-54f16895a1dd - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -523,7 +523,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 9405ca8b-7b7d-4271-80d1-41901f84c9e8 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -550,7 +550,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 4ce29152-4749-43a7-89b4-b8265bf35b09 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -577,7 +577,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 5ebe0d65-e661-4e6b-a053-a3a22adec893 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -604,7 +604,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 38e3c8d5-0c3e-465f-8a79-4117dbcd7607 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -631,7 +631,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: d966df8b-e9d3-41d5-9b25-6c1a5ec9d3dc - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -658,7 +658,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 22a22d93-0ec2-4c90-91b1-29a0b3ea9173 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: Current phase of the pod (1 - Pending, 2 - Running, 3 - Succeeded, 4 - Failed, 5 - Unknown) @@ -697,7 +697,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 16463557-8966-458d-b356-54f16895a1dd - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -757,7 +757,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 9405ca8b-7b7d-4271-80d1-41901f84c9e8 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -831,7 +831,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 4ce29152-4749-43a7-89b4-b8265bf35b09 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -884,7 +884,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: d966df8b-e9d3-41d5-9b25-6c1a5ec9d3dc - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -937,7 +937,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 5ebe0d65-e661-4e6b-a053-a3a22adec893 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -990,7 +990,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 38e3c8d5-0c3e-465f-8a79-4117dbcd7607 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -1036,7 +1036,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: ebd4da01-4a19-4ed8-bb2b-a75fa9c66160 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -1103,7 +1103,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 5e4d1b29-35e5-4ff6-9779-b02921adcace - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -1177,7 +1177,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 22a22d93-0ec2-4c90-91b1-29a0b3ea9173 - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that. @@ -1223,7 +1223,7 @@ resourceMetrics: - key: k8s.pod.uid value: stringValue: 2c672907-5d69-4f91-85e0-f1792164cadc - schemaUrl: "https://opentelemetry.io/schemas/1.18.0" + schemaUrl: "https://opentelemetry.io/schemas/1.27.0" scopeMetrics: - metrics: - description: How many times the container has restarted in the recent past. This value is pulled directly from the K8s API and the value can go indefinitely high and be reset to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best to not depend too much on the exact value but rather look at it as either == 0, in which case you can conclude there were no restarts in the recent past, or > 0, in which case you can conclude there were restarts in the recent past, and not try and analyze the value beyond that.