From 0c652bf292c2b97bbc8a257adf296652d950bc3a Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sun, 8 Sep 2024 20:47:07 +0530 Subject: [PATCH] Fix lint (#384) --- exporter/clickhouselogsexporter/logsv2/hash.go | 2 +- migrationmanager/migrators/basemigrator/logger.go | 2 +- processor/signoztailsampler/evaluator.go | 2 +- processor/signoztailsampler/evaluator_test.go | 2 +- processor/signoztransformprocessor/config.go | 2 +- processor/signoztransformprocessor/internal/logs/processor.go | 2 +- .../signoztransformprocessor/internal/logs/processor_test.go | 2 +- .../signoztransformprocessor/internal/metrics/processor.go | 2 +- .../signoztransformprocessor/internal/metrics/processor_test.go | 2 +- processor/signoztransformprocessor/internal/traces/processor.go | 2 +- .../signoztransformprocessor/internal/traces/processor_test.go | 2 +- receiver/httplogreceiver/internal/metadata/generated_status.go | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/exporter/clickhouselogsexporter/logsv2/hash.go b/exporter/clickhouselogsexporter/logsv2/hash.go index 6592e473..1e77ab65 100644 --- a/exporter/clickhouselogsexporter/logsv2/hash.go +++ b/exporter/clickhouselogsexporter/logsv2/hash.go @@ -35,7 +35,7 @@ func FingerprintHash(attribs map[string]any) uint64 { } keys := []string{} - for k, _ := range attribs { + for k := range attribs { keys = append(keys, k) } diff --git a/migrationmanager/migrators/basemigrator/logger.go b/migrationmanager/migrators/basemigrator/logger.go index 1eb7c393..4659fb33 100644 --- a/migrationmanager/migrators/basemigrator/logger.go +++ b/migrationmanager/migrators/basemigrator/logger.go @@ -13,7 +13,7 @@ type zapLoggerAdapter struct { func newZapLoggerAdapter(logger *zap.Logger, verboseLoggingEnabled bool) *zapLoggerAdapter { return &zapLoggerAdapter{ - Logger: logger, + Logger: logger, VerboseLoggingEnabled: verboseLoggingEnabled, } } diff --git a/processor/signoztailsampler/evaluator.go b/processor/signoztailsampler/evaluator.go index 0582fa7b..57788d3b 100644 --- a/processor/signoztailsampler/evaluator.go +++ b/processor/signoztailsampler/evaluator.go @@ -94,7 +94,7 @@ func prepareFilterEvaluators(logger *zap.Logger, policyFilterCfg PolicyFilterCfg return filterEvaluators } -// Evaluate executes policy filter first to determine if the policy applies to current trace data +// Evaluate executes policy filter first to determine if the policy applies to current trace data // and if it succeeds, then sampling is performed based on sampling params set on the // selected policy. This method works for both root and sub-policies. func (de *defaultEvaluator) Evaluate(traceId pcommon.TraceID, trace *sampling.TraceData) (sampling.Decision, error) { diff --git a/processor/signoztailsampler/evaluator_test.go b/processor/signoztailsampler/evaluator_test.go index 7b39445a..d5bc7b72 100644 --- a/processor/signoztailsampler/evaluator_test.go +++ b/processor/signoztailsampler/evaluator_test.go @@ -311,7 +311,7 @@ func newTraceStringAttrs(nodeAttrs map[string]interface{}, spanAttrKey []string, span := ils.Spans().AppendEmpty() span.SetTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}) span.SetSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8}) - for i, _ := range spanAttrKey { + for i := range spanAttrKey { span.Attributes().PutStr(spanAttrKey[i], spanAttrValue[i]) } diff --git a/processor/signoztransformprocessor/config.go b/processor/signoztransformprocessor/config.go index 1b9f6a23..0b91a2e3 100644 --- a/processor/signoztransformprocessor/config.go +++ b/processor/signoztransformprocessor/config.go @@ -8,11 +8,11 @@ import ( "go.uber.org/multierr" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/logs" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/metrics" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/traces" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) // Config defines the configuration for the processor. diff --git a/processor/signoztransformprocessor/internal/logs/processor.go b/processor/signoztransformprocessor/internal/logs/processor.go index 4ab07c0a..d78d5d7f 100644 --- a/processor/signoztransformprocessor/internal/logs/processor.go +++ b/processor/signoztransformprocessor/internal/logs/processor.go @@ -12,8 +12,8 @@ import ( "go.uber.org/multierr" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) type Processor struct { diff --git a/processor/signoztransformprocessor/internal/logs/processor_test.go b/processor/signoztransformprocessor/internal/logs/processor_test.go index de07a094..3cc79c0a 100644 --- a/processor/signoztransformprocessor/internal/logs/processor_test.go +++ b/processor/signoztransformprocessor/internal/logs/processor_test.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) var ( diff --git a/processor/signoztransformprocessor/internal/metrics/processor.go b/processor/signoztransformprocessor/internal/metrics/processor.go index 047349d4..8f2451e6 100644 --- a/processor/signoztransformprocessor/internal/metrics/processor.go +++ b/processor/signoztransformprocessor/internal/metrics/processor.go @@ -12,8 +12,8 @@ import ( "go.uber.org/multierr" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) type Processor struct { diff --git a/processor/signoztransformprocessor/internal/metrics/processor_test.go b/processor/signoztransformprocessor/internal/metrics/processor_test.go index 256e0f8b..d6f9f14a 100644 --- a/processor/signoztransformprocessor/internal/metrics/processor_test.go +++ b/processor/signoztransformprocessor/internal/metrics/processor_test.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) var ( diff --git a/processor/signoztransformprocessor/internal/traces/processor.go b/processor/signoztransformprocessor/internal/traces/processor.go index e141325e..f187229d 100644 --- a/processor/signoztransformprocessor/internal/traces/processor.go +++ b/processor/signoztransformprocessor/internal/traces/processor.go @@ -12,8 +12,8 @@ import ( "go.uber.org/multierr" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) type Processor struct { diff --git a/processor/signoztransformprocessor/internal/traces/processor_test.go b/processor/signoztransformprocessor/internal/traces/processor_test.go index ea106bee..4ca1237f 100644 --- a/processor/signoztransformprocessor/internal/traces/processor_test.go +++ b/processor/signoztransformprocessor/internal/traces/processor_test.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/SigNoz/signoz-otel-collector/processor/signoztransformprocessor/internal/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) var ( diff --git a/receiver/httplogreceiver/internal/metadata/generated_status.go b/receiver/httplogreceiver/internal/metadata/generated_status.go index e7802938..c144d420 100644 --- a/receiver/httplogreceiver/internal/metadata/generated_status.go +++ b/receiver/httplogreceiver/internal/metadata/generated_status.go @@ -9,4 +9,4 @@ import ( const ( Type = "httplogreceiver" LogsStability = component.StabilityLevelAlpha -) \ No newline at end of file +)