From 1addea1c3dc42b5c951aef40367886b15a27901d Mon Sep 17 00:00:00 2001 From: Tim Chan Date: Thu, 13 Jun 2024 07:44:47 -0700 Subject: [PATCH] fixed constants --- .../sampling/drop_trace_factory.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/processor/cascadingfilterprocessor/sampling/drop_trace_factory.go b/pkg/processor/cascadingfilterprocessor/sampling/drop_trace_factory.go index 2205fdcf5e..9ae35a698d 100644 --- a/pkg/processor/cascadingfilterprocessor/sampling/drop_trace_factory.go +++ b/pkg/processor/cascadingfilterprocessor/sampling/drop_trace_factory.go @@ -19,17 +19,12 @@ import ( "regexp" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/zap" "github.com/SumoLogic/sumologic-otel-collector/pkg/processor/cascadingfilterprocessor/config" ) -const ( - StatusCodeError = "Error" - StatusCodeOk = "Ok" - StatusCodeUnset = "Unset" -) - type dropTraceEvaluator struct { numericAttr *numericAttributeFilter stringAttr *stringAttributeFilter @@ -45,7 +40,11 @@ func validateStatusCode(statusCode *string) error { return nil } - validStatusCodes := []string{StatusCodeError, StatusCodeOk, StatusCodeUnset} + validStatusCodes := []string{ + ptrace.StatusCodeError.String(), + ptrace.StatusCodeOk.String(), + ptrace.StatusCodeUnset.String(), + } for _, valid := range validStatusCodes { if *statusCode == valid {