From b4ff374864f079d18b4c7e0306c100835efbbaec Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 12 Sep 2023 17:31:54 -0400 Subject: [PATCH 1/4] Lint fixes --- exporter/jaegerthrifthttpexporter/README.md | 2 +- .../internal/stores/podstore.go | 12 ++---------- .../internal/stores/podstore_test.go | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/exporter/jaegerthrifthttpexporter/README.md b/exporter/jaegerthrifthttpexporter/README.md index 9a57e133bb4b..694a960bbeb0 100644 --- a/exporter/jaegerthrifthttpexporter/README.md +++ b/exporter/jaegerthrifthttpexporter/README.md @@ -16,7 +16,7 @@ This exporter is being deprecated and will be removed in July 2023 as Jaeger sup This exporter supports sending trace data to [Jaeger](https://www.jaegertracing.io) over Thrift HTTP. -*WARNING:* The [Jaeger gRPC Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/jaegerexporter) is the recommended one for exporting traces from an OpenTelemetry Collector to Jaeger. This Jaeger Thrift Exporter should only be used to export traces to a Jaeger Collector that is unable to expose the [gRPC API](https://www.jaegertracing.io/docs/1.27/apis/#protobuf-via-grpc-stable). +*WARNING:* The Jaeger gRPC Exporter is the recommended one for exporting traces from an OpenTelemetry Collector to Jaeger. This Jaeger Thrift Exporter should only be used to export traces to a Jaeger Collector that is unable to expose the [gRPC API](https://www.jaegertracing.io/docs/1.27/apis/#protobuf-via-grpc-stable). ## Configuration diff --git a/receiver/awscontainerinsightreceiver/internal/stores/podstore.go b/receiver/awscontainerinsightreceiver/internal/stores/podstore.go index a14817a8c2aa..a90b2a70e207 100644 --- a/receiver/awscontainerinsightreceiver/internal/stores/podstore.go +++ b/receiver/awscontainerinsightreceiver/internal/stores/podstore.go @@ -608,11 +608,7 @@ func (p *PodStore) addPodContainerStatusMetrics(metric CIMetric, pod *corev1.Pod reason := containerStatus.State.Waiting.Reason if reason != "" { if val, ok := ci.WaitingReasonLookup[reason]; ok { - if _, foundStatus := possibleStatuses[val]; foundStatus { - possibleStatuses[val]++ - } else { - possibleStatuses[val] = 1 - } + possibleStatuses[val]++ } } case containerStatus.State.Terminated != nil: @@ -624,11 +620,7 @@ func (p *PodStore) addPodContainerStatusMetrics(metric CIMetric, pod *corev1.Pod if containerStatus.LastTerminationState.Terminated != nil && containerStatus.LastTerminationState.Terminated.Reason != "" { if strings.Contains(containerStatus.LastTerminationState.Terminated.Reason, "OOMKilled") { - if _, foundStatus := possibleStatuses[ci.StatusContainerTerminatedReasonOOMKilled]; foundStatus { - possibleStatuses[ci.StatusContainerTerminatedReasonOOMKilled]++ - } else { - possibleStatuses[ci.StatusContainerTerminatedReasonOOMKilled] = 1 - } + possibleStatuses[ci.StatusContainerTerminatedReasonOOMKilled]++ } } } diff --git a/receiver/awscontainerinsightreceiver/internal/stores/podstore_test.go b/receiver/awscontainerinsightreceiver/internal/stores/podstore_test.go index 367ee59f8dbf..9e1f4ea8d299 100644 --- a/receiver/awscontainerinsightreceiver/internal/stores/podstore_test.go +++ b/receiver/awscontainerinsightreceiver/internal/stores/podstore_test.go @@ -720,7 +720,7 @@ func TestPodStore_addStatus_enhanced_metrics(t *testing.T) { metric = generateMetric(fields, tags) podStore.addStatus(metric, pod) - //assert.Equal(t, "Waiting", metric.GetTag(ci.ContainerStatus)) + // assert.Equal(t, "Waiting", metric.GetTag(ci.ContainerStatus)) assert.Equal(t, 2, metric.GetField(ci.MetricName(ci.TypePod, ci.StatusContainerWaiting))) assert.Equal(t, 2, metric.GetField(ci.MetricName(ci.TypePod, ci.StatusContainerWaitingReasonCrashLoopBackOff))) // sparse metrics From 4db44fe802bc3b58868a12278862a3292c3577eb Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Tue, 10 Oct 2023 00:17:32 -0700 Subject: [PATCH 2/4] [chore] [receiver/sqlquery] Skip TestOracleDBIntegrationMetrics (#27579) To unblock the CI until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27577 is fixed (cherry picked from commit 0efc53acfe4e89725b30a8444499c9513dc1a7e9) --- receiver/sqlqueryreceiver/integration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/receiver/sqlqueryreceiver/integration_test.go b/receiver/sqlqueryreceiver/integration_test.go index 4fd470c2f909..3fc9a558b30e 100644 --- a/receiver/sqlqueryreceiver/integration_test.go +++ b/receiver/sqlqueryreceiver/integration_test.go @@ -443,6 +443,7 @@ func TestPostgresqlIntegrationMetrics(t *testing.T) { // This test ensures the collector can connect to an Oracle DB, and properly get metrics. It's not intended to // test the receiver itself. func TestOracleDBIntegrationMetrics(t *testing.T) { + t.Skip("Skipping the test until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27577 is fixed") if runtime.GOARCH == "arm64" { t.Skip("Incompatible with arm64") } From 187fa8bb4d41819e2ff0fad2e3ea13546b291c77 Mon Sep 17 00:00:00 2001 From: Kaushik Surya Date: Wed, 11 Oct 2023 16:44:52 -0400 Subject: [PATCH 3/4] Lint fixes --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e91e2fc43e..750eb2ff3f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3538,7 +3538,7 @@ https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/9278. - [`cumulativetodelta` processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/cumulativetodeltaprocessor) to convert cumulative sum metrics to cumulative delta - [`file` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/fileexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) -- [`jaeger` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/jaegerexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) +- [`jaeger` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.85.0/exporter/jaegerexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) - [`kafka` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/kafkaexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) - [`opencensus` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/opencensusexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) - [`prometheus` exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusexporter) from core repository ([#3474](https://github.com/open-telemetry/opentelemetry-collector/issues/3474)) From 3ad9e0bf4a83ad538b580be7620e77c63168a845 Mon Sep 17 00:00:00 2001 From: Kaushik Surya Date: Wed, 11 Oct 2023 17:23:55 -0400 Subject: [PATCH 4/4] Lint fixes --- .../awsemfexporter/metric_translator_test.go | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/exporter/awsemfexporter/metric_translator_test.go b/exporter/awsemfexporter/metric_translator_test.go index 36b39c87bf31..30e9759171a2 100644 --- a/exporter/awsemfexporter/metric_translator_test.go +++ b/exporter/awsemfexporter/metric_translator_test.go @@ -1456,22 +1456,22 @@ func TestGroupedMetricToCWMeasurementsWithFilters(t *testing.T) { MetricNameSelectors: []string{"metric(1|3)"}, }, }, []cWMeasurement{ - { - Namespace: namespace, - Dimensions: [][]string{{}}, - Metrics: []map[string]string{ - { - "Name": "metric1", - "Unit": "Count", - }, - { - "Name": "metric3", - "Unit": "Seconds", + { + Namespace: namespace, + Dimensions: [][]string{{}}, + Metrics: []map[string]string{ + { + "Name": "metric1", + "Unit": "Count", + }, + { + "Name": "metric3", + "Unit": "Seconds", + }, }, }, }, }, - }, { "label matchers", []*MetricDeclaration{