diff --git a/processor/cascadingfilterprocessor/config_test.go b/processor/cascadingfilterprocessor/config_test.go index 5c63a2d87d7e..f8bfa0c61ca2 100644 --- a/processor/cascadingfilterprocessor/config_test.go +++ b/processor/cascadingfilterprocessor/config_test.go @@ -61,11 +61,11 @@ func TestLoadConfig(t *testing.T) { NamePattern: &healthCheckNamePatternValue, }, { - Name: "remove-all-traces-with-healthcheck-service", - NamePattern: nil, + Name: "remove-all-traces-with-healthcheck-service", + NamePattern: nil, NumericAttributeCfg: nil, StringAttributeCfg: &cfconfig.StringAttributeCfg{ - Key: "service.name", + Key: "service.name", Values: []string{"healthcheck"}, }, }, diff --git a/processor/sourceprocessor/attribute_filler.go b/processor/sourceprocessor/attribute_filler.go index b8ea866b36ea..e64fd467454c 100644 --- a/processor/sourceprocessor/attribute_filler.go +++ b/processor/sourceprocessor/attribute_filler.go @@ -82,21 +82,21 @@ func createSourceCategoryFiller(cfg *Config, keys sourceTraceKeys) attributeFill return filler } -func (f *attributeFiller) fillResourceOrUseAnnotation(atts *pdata.AttributeMap, annotationKey string, keys sourceTraceKeys) bool { +func (f *attributeFiller) fillResourceOrUseAnnotation(atts *pdata.AttributeMap, annotationKey string, keys sourceTraceKeys) { val, found := atts.Get(annotationKey) if found { annotationFiller := extractFormat(val.StringVal(), f.name, keys) annotationFiller.dashReplacement = f.dashReplacement annotationFiller.compiledFormat = f.prefix + annotationFiller.compiledFormat - return annotationFiller.fillAttributes(atts) + annotationFiller.fillAttributes(atts) + } else { + f.fillAttributes(atts) } - - return f.fillAttributes(atts) } -func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) bool { +func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) { if len(f.compiledFormat) == 0 { - return false + return } labelValues := f.resourceLabelValues(atts) @@ -106,9 +106,7 @@ func (f *attributeFiller) fillAttributes(atts *pdata.AttributeMap) bool { str = strings.ReplaceAll(str, "-", f.dashReplacement) } atts.UpsertString(f.name, str) - return true } - return false } func (f *attributeFiller) resourceLabelValues(atts *pdata.AttributeMap) []interface{} { diff --git a/processor/sourceprocessor/factory.go b/processor/sourceprocessor/factory.go index b48cb6f83be3..39e279299a5d 100644 --- a/processor/sourceprocessor/factory.go +++ b/processor/sourceprocessor/factory.go @@ -81,7 +81,7 @@ func createDefaultConfig() config.Processor { // createTraceProcessor creates a trace processor based on this config. func createTraceProcessor( _ context.Context, - params component.ProcessorCreateSettings, + _ component.ProcessorCreateSettings, cfg config.Processor, next consumer.Traces) (component.TracesProcessor, error) {