From e45656ce3b2dad7a3c0c7e2194697b40e33a8916 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 12 Sep 2023 17:31:54 -0400 Subject: [PATCH] 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