diff --git a/pkg/ottl/expression.go b/pkg/ottl/expression.go index c83b5f90b5605..18e5ffad56ce5 100644 --- a/pkg/ottl/expression.go +++ b/pkg/ottl/expression.go @@ -280,15 +280,7 @@ func (g StandardFunctionGetter[K]) Get(args Arguments) (Expr[K], error) { } for i := 0; i < fArgsVal.NumField(); i++ { field := argsVal.Field(i) - argIndex, err := getArgumentIndex(i, argsVal) - if err != nil { - return Expr[K]{}, err - } - fArgIndex, err := getArgumentIndex(argIndex, fArgsVal) - if err != nil { - return Expr[K]{}, err - } - fArgsVal.Field(fArgIndex).Set(field) + fArgsVal.Field(i).Set(field) } fn, err := g.fact.CreateFunction(g.fCtx, fArgs) if err != nil { diff --git a/pkg/ottl/expression_test.go b/pkg/ottl/expression_test.go index 605921d78b208..af0ee2b8e3b07 100644 --- a/pkg/ottl/expression_test.go +++ b/pkg/ottl/expression_test.go @@ -690,11 +690,6 @@ func Test_FunctionGetter(t *testing.T) { &multipleArgsArguments{}, functionWithStringGetter, ), - createFactory[any]( - "no_struct_tag", - &noStructTagFunctionArguments{}, - functionWithStringGetter, - ), NewFactory( "cannot_create_function", &stringGetterArguments{}, @@ -753,18 +748,6 @@ func Test_FunctionGetter(t *testing.T) { valid: false, expectedErrorMsg: "incorrect number of arguments. Expected: 4 Received: 1", }, - { - name: "Invalid Arguments struct tag", - getter: StandardStringGetter[interface{}]{ - Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) { - return nil, nil - }, - }, - function: StandardFunctionGetter[any]{fCtx: FunctionContext{Set: componenttest.NewNopTelemetrySettings()}, fact: functions["no_struct_tag"]}, - want: "anything", - valid: false, - expectedErrorMsg: "no `ottlarg` struct tag on Arguments field \"StringArg\"", - }, { name: "Cannot create function", getter: StandardStringGetter[interface{}]{ diff --git a/pkg/ottl/functions.go b/pkg/ottl/functions.go index 46845ac85f3cf..fea6c99ba81d4 100644 --- a/pkg/ottl/functions.go +++ b/pkg/ottl/functions.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "reflect" - "strconv" "strings" ) @@ -47,22 +46,6 @@ func (p *Parser[K]) newFunctionCall(ed editor) (Expr[K], error) { return Expr[K]{exprFunc: fn}, err } -func getArgumentIndex(index int, args reflect.Value) (int, error) { - argsType := args.Type() - fieldTag, ok := argsType.Field(index).Tag.Lookup("ottlarg") - if !ok { - return 0, fmt.Errorf("no `ottlarg` struct tag on Arguments field %q", argsType.Field(index).Name) - } - argNum, err := strconv.Atoi(fieldTag) - if err != nil { - return 0, fmt.Errorf("ottlarg struct tag on field %q is not a valid integer: %w", argsType.Field(index).Name, err) - } - if argNum < 0 || argNum >= args.NumField() { - return 0, fmt.Errorf("ottlarg struct tag on field %q has value %d, but must be between 0 and %d", argsType.Field(index).Name, argNum, args.NumField()) - } - return argNum, nil -} - func (p *Parser[K]) buildArgs(ed editor, argsVal reflect.Value) error { if len(ed.Arguments) != argsVal.NumField() { return fmt.Errorf("incorrect number of arguments. Expected: %d Received: %d", argsVal.NumField(), len(ed.Arguments)) @@ -71,12 +54,9 @@ func (p *Parser[K]) buildArgs(ed editor, argsVal reflect.Value) error { for i := 0; i < argsVal.NumField(); i++ { field := argsVal.Field(i) fieldType := field.Type() - argNum, err := getArgumentIndex(i, argsVal) - if err != nil { - return err - } - argVal := ed.Arguments[argNum] + argVal := ed.Arguments[i] var val any + var err error switch { case strings.HasPrefix(fieldType.Name(), "FunctionGetter"): var name string diff --git a/pkg/ottl/functions_test.go b/pkg/ottl/functions_test.go index 55ca83e432cbe..cd7dbf2f97ce3 100644 --- a/pkg/ottl/functions_test.go +++ b/pkg/ottl/functions_test.go @@ -63,31 +63,6 @@ func Test_NewFunctionCall_invalid(t *testing.T) { errorFunctionArguments{}, functionThatHasAnError, ), - createFactory( - "no_struct_tag", - &noStructTagFunctionArguments{}, - functionThatHasAnError, - ), - createFactory( - "wrong_struct_tag", - &wrongTagFunctionArguments{}, - functionThatHasAnError, - ), - createFactory( - "bad_struct_tag", - &badStructTagFunctionArguments{}, - functionThatHasAnError, - ), - createFactory( - "negative_struct_tag", - &negativeStructTagFunctionArguments{}, - functionThatHasAnError, - ), - createFactory( - "out_of_bounds_struct_tag", - &outOfBoundsStructTagFunctionArguments{}, - functionThatHasAnError, - ), createFactory( "testing_unknown_function", &functionGetterArguments{}, @@ -349,61 +324,6 @@ func Test_NewFunctionCall_invalid(t *testing.T) { Function: "non_pointer", }, }, - { - name: "no struct tags", - inv: editor{ - Function: "no_struct_tag", - Arguments: []value{ - { - String: ottltest.Strp("str"), - }, - }, - }, - }, - { - name: "using the wrong struct tag", - inv: editor{ - Function: "wrong_struct_tag", - Arguments: []value{ - { - String: ottltest.Strp("str"), - }, - }, - }, - }, - { - name: "non-integer struct tags", - inv: editor{ - Function: "bad_struct_tag", - Arguments: []value{ - { - String: ottltest.Strp("str"), - }, - }, - }, - }, - { - name: "struct tag index too low", - inv: editor{ - Function: "negative_struct_tag", - Arguments: []value{ - { - String: ottltest.Strp("str"), - }, - }, - }, - }, - { - name: "struct tag index too high", - inv: editor{ - Function: "out_of_bounds_struct_tag", - Arguments: []value{ - { - String: ottltest.Strp("str"), - }, - }, - }, - }, } for _, tt := range tests { @@ -1612,26 +1532,6 @@ func functionWithEnum(Enum) (ExprFunc[interface{}], error) { }, nil } -type noStructTagFunctionArguments struct { - StringArg string -} - -type badStructTagFunctionArguments struct { - StringArg string `ottlarg:"a"` -} - -type negativeStructTagFunctionArguments struct { - StringArg string `ottlarg:"-1"` -} - -type outOfBoundsStructTagFunctionArguments struct { - StringArg string `ottlarg:"1"` -} - -type wrongTagFunctionArguments struct { - StringArg string `argument:"1"` -} - func createFactory[A any](name string, args A, fn any) Factory[any] { createFunction := func(fCtx FunctionContext, oArgs Arguments) (ExprFunc[any], error) { fArgs, ok := oArgs.(A) diff --git a/pkg/ottl/ottlfuncs/func_concat.go b/pkg/ottl/ottlfuncs/func_concat.go index cdf1a11acbdf2..08a0db0d863cc 100644 --- a/pkg/ottl/ottlfuncs/func_concat.go +++ b/pkg/ottl/ottlfuncs/func_concat.go @@ -12,8 +12,8 @@ import ( ) type ConcatArguments[K any] struct { - Vals []ottl.StringLikeGetter[K] `ottlarg:"0"` - Delimiter string `ottlarg:"1"` + Vals []ottl.StringLikeGetter[K] + Delimiter string } func NewConcatFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_convert_case.go b/pkg/ottl/ottlfuncs/func_convert_case.go index 4fd71ab9ffb41..79970fd3322f1 100644 --- a/pkg/ottl/ottlfuncs/func_convert_case.go +++ b/pkg/ottl/ottlfuncs/func_convert_case.go @@ -14,8 +14,8 @@ import ( ) type ConvertCaseArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` - ToCase string `ottlarg:"1"` + Target ottl.StringGetter[K] + ToCase string } func NewConvertCaseFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_delete_key.go b/pkg/ottl/ottlfuncs/func_delete_key.go index 3bbe0879f16ac..443f3d8df5b12 100644 --- a/pkg/ottl/ottlfuncs/func_delete_key.go +++ b/pkg/ottl/ottlfuncs/func_delete_key.go @@ -11,8 +11,8 @@ import ( ) type DeleteKeyArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Key string `ottlarg:"1"` + Target ottl.PMapGetter[K] + Key string } func NewDeleteKeyFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_delete_matching_keys.go b/pkg/ottl/ottlfuncs/func_delete_matching_keys.go index ab0e5078776d4..18144d046889e 100644 --- a/pkg/ottl/ottlfuncs/func_delete_matching_keys.go +++ b/pkg/ottl/ottlfuncs/func_delete_matching_keys.go @@ -14,8 +14,8 @@ import ( ) type DeleteMatchingKeysArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Pattern string `ottlarg:"1"` + Target ottl.PMapGetter[K] + Pattern string } func NewDeleteMatchingKeysFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_duration.go b/pkg/ottl/ottlfuncs/func_duration.go index 85d0c6f27edaf..395d1fed05bed 100644 --- a/pkg/ottl/ottlfuncs/func_duration.go +++ b/pkg/ottl/ottlfuncs/func_duration.go @@ -12,7 +12,7 @@ import ( ) type DurationArguments[K any] struct { - Duration ottl.StringGetter[K] `ottlarg:"0"` + Duration ottl.StringGetter[K] } func NewDurationFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_fnv.go b/pkg/ottl/ottlfuncs/func_fnv.go index 026a4d1f1b02d..8da56e5997484 100644 --- a/pkg/ottl/ottlfuncs/func_fnv.go +++ b/pkg/ottl/ottlfuncs/func_fnv.go @@ -12,7 +12,7 @@ import ( ) type FnvArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` + Target ottl.StringGetter[K] } func NewFnvFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_int.go b/pkg/ottl/ottlfuncs/func_int.go index 2de3c39fe18c8..94c7c1356394c 100644 --- a/pkg/ottl/ottlfuncs/func_int.go +++ b/pkg/ottl/ottlfuncs/func_int.go @@ -11,7 +11,7 @@ import ( ) type IntArguments[K any] struct { - Target ottl.IntLikeGetter[K] `ottlarg:"0"` + Target ottl.IntLikeGetter[K] } func NewIntFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_is_map.go b/pkg/ottl/ottlfuncs/func_is_map.go index afb470b9bf3f9..25dfb83839946 100644 --- a/pkg/ottl/ottlfuncs/func_is_map.go +++ b/pkg/ottl/ottlfuncs/func_is_map.go @@ -11,7 +11,7 @@ import ( ) type IsMapArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` + Target ottl.PMapGetter[K] } func NewIsMapFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_is_match.go b/pkg/ottl/ottlfuncs/func_is_match.go index a4e48b9de345b..b9f09c11cf207 100644 --- a/pkg/ottl/ottlfuncs/func_is_match.go +++ b/pkg/ottl/ottlfuncs/func_is_match.go @@ -12,8 +12,8 @@ import ( ) type IsMatchArguments[K any] struct { - Target ottl.StringLikeGetter[K] `ottlarg:"0"` - Pattern string `ottlarg:"1"` + Target ottl.StringLikeGetter[K] + Pattern string } func NewIsMatchFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_is_string.go b/pkg/ottl/ottlfuncs/func_is_string.go index 62560ab8244bb..29d2a1843c936 100644 --- a/pkg/ottl/ottlfuncs/func_is_string.go +++ b/pkg/ottl/ottlfuncs/func_is_string.go @@ -11,7 +11,7 @@ import ( ) type IsStringArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` + Target ottl.StringGetter[K] } func NewIsStringFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_keep_keys.go b/pkg/ottl/ottlfuncs/func_keep_keys.go index 035bade156c31..59b58ead88ea7 100644 --- a/pkg/ottl/ottlfuncs/func_keep_keys.go +++ b/pkg/ottl/ottlfuncs/func_keep_keys.go @@ -13,8 +13,8 @@ import ( ) type KeepKeysArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Keys []string `ottlarg:"1"` + Target ottl.PMapGetter[K] + Keys []string } func NewKeepKeysFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_len.go b/pkg/ottl/ottlfuncs/func_len.go index a1d9e50940a27..9a566b05562c8 100644 --- a/pkg/ottl/ottlfuncs/func_len.go +++ b/pkg/ottl/ottlfuncs/func_len.go @@ -21,7 +21,7 @@ const ( ) type LenArguments[K any] struct { - Target ottl.Getter[K] `ottlarg:"0"` + Target ottl.Getter[K] } func NewLenFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_limit.go b/pkg/ottl/ottlfuncs/func_limit.go index 51a645df8aa3f..1fec372fa1747 100644 --- a/pkg/ottl/ottlfuncs/func_limit.go +++ b/pkg/ottl/ottlfuncs/func_limit.go @@ -13,9 +13,9 @@ import ( ) type LimitArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Limit int64 `ottlarg:"1"` - PriorityKeys []string `ottlarg:"2"` + Target ottl.PMapGetter[K] + Limit int64 + PriorityKeys []string } func NewLimitFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_log.go b/pkg/ottl/ottlfuncs/func_log.go index 1f24c197f5605..8e6111ad8fb8e 100644 --- a/pkg/ottl/ottlfuncs/func_log.go +++ b/pkg/ottl/ottlfuncs/func_log.go @@ -12,7 +12,7 @@ import ( ) type LogArguments[K any] struct { - Target ottl.FloatLikeGetter[K] `ottlarg:"0"` + Target ottl.FloatLikeGetter[K] } func NewLogFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_merge_maps.go b/pkg/ottl/ottlfuncs/func_merge_maps.go index e9d24a160f656..5560def71010a 100644 --- a/pkg/ottl/ottlfuncs/func_merge_maps.go +++ b/pkg/ottl/ottlfuncs/func_merge_maps.go @@ -19,9 +19,9 @@ const ( ) type MergeMapsArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Source ottl.PMapGetter[K] `ottlarg:"1"` - Strategy string `ottlarg:"2"` + Target ottl.PMapGetter[K] + Source ottl.PMapGetter[K] + Strategy string } func NewMergeMapsFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_parse_json.go b/pkg/ottl/ottlfuncs/func_parse_json.go index 4355dd62c7c73..7ca06f83034b0 100644 --- a/pkg/ottl/ottlfuncs/func_parse_json.go +++ b/pkg/ottl/ottlfuncs/func_parse_json.go @@ -14,7 +14,7 @@ import ( ) type ParseJSONArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` + Target ottl.StringGetter[K] } func NewParseJSONFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_replace_all_matches.go b/pkg/ottl/ottlfuncs/func_replace_all_matches.go index 457a4582477cd..4a686be2e9587 100644 --- a/pkg/ottl/ottlfuncs/func_replace_all_matches.go +++ b/pkg/ottl/ottlfuncs/func_replace_all_matches.go @@ -14,9 +14,9 @@ import ( ) type ReplaceAllMatchesArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Pattern string `ottlarg:"1"` - Replacement ottl.StringGetter[K] `ottlarg:"2"` + Target ottl.PMapGetter[K] + Pattern string + Replacement ottl.StringGetter[K] } func NewReplaceAllMatchesFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_replace_all_patterns.go b/pkg/ottl/ottlfuncs/func_replace_all_patterns.go index f4d9044c93a56..c583f00a34ba8 100644 --- a/pkg/ottl/ottlfuncs/func_replace_all_patterns.go +++ b/pkg/ottl/ottlfuncs/func_replace_all_patterns.go @@ -19,10 +19,10 @@ const ( ) type ReplaceAllPatternsArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Mode string `ottlarg:"1"` - RegexPattern string `ottlarg:"2"` - Replacement ottl.StringGetter[K] `ottlarg:"3"` + Target ottl.PMapGetter[K] + Mode string + RegexPattern string + Replacement ottl.StringGetter[K] } func NewReplaceAllPatternsFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_replace_match.go b/pkg/ottl/ottlfuncs/func_replace_match.go index 3e15bb87c849a..578e84becfff6 100644 --- a/pkg/ottl/ottlfuncs/func_replace_match.go +++ b/pkg/ottl/ottlfuncs/func_replace_match.go @@ -13,9 +13,9 @@ import ( ) type ReplaceMatchArguments[K any] struct { - Target ottl.GetSetter[K] `ottlarg:"0"` - Pattern string `ottlarg:"1"` - Replacement ottl.StringGetter[K] `ottlarg:"2"` + Target ottl.GetSetter[K] + Pattern string + Replacement ottl.StringGetter[K] } func NewReplaceMatchFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_replace_pattern.go b/pkg/ottl/ottlfuncs/func_replace_pattern.go index cd5139d1c5149..1386fec80c010 100644 --- a/pkg/ottl/ottlfuncs/func_replace_pattern.go +++ b/pkg/ottl/ottlfuncs/func_replace_pattern.go @@ -12,9 +12,9 @@ import ( ) type ReplacePatternArguments[K any] struct { - Target ottl.GetSetter[K] `ottlarg:"0"` - RegexPattern string `ottlarg:"1"` - Replacement ottl.StringGetter[K] `ottlarg:"2"` + Target ottl.GetSetter[K] + RegexPattern string + Replacement ottl.StringGetter[K] } func NewReplacePatternFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_set.go b/pkg/ottl/ottlfuncs/func_set.go index 104fd9fdd4a65..6a8f0da3f0fb5 100644 --- a/pkg/ottl/ottlfuncs/func_set.go +++ b/pkg/ottl/ottlfuncs/func_set.go @@ -11,8 +11,8 @@ import ( ) type SetArguments[K any] struct { - Target ottl.Setter[K] `ottlarg:"0"` - Value ottl.Getter[K] `ottlarg:"1"` + Target ottl.Setter[K] + Value ottl.Getter[K] } func NewSetFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_sha1.go b/pkg/ottl/ottlfuncs/func_sha1.go index f8eb721b935ac..e091d2110fb6d 100644 --- a/pkg/ottl/ottlfuncs/func_sha1.go +++ b/pkg/ottl/ottlfuncs/func_sha1.go @@ -13,7 +13,7 @@ import ( ) type SHA1Arguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` + Target ottl.StringGetter[K] } func NewSHA1Factory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_sha256.go b/pkg/ottl/ottlfuncs/func_sha256.go index fc8a9259b311f..179d8bbe7b2ff 100644 --- a/pkg/ottl/ottlfuncs/func_sha256.go +++ b/pkg/ottl/ottlfuncs/func_sha256.go @@ -13,7 +13,7 @@ import ( ) type SHA256Arguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` + Target ottl.StringGetter[K] } func NewSHA256Factory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_span_id.go b/pkg/ottl/ottlfuncs/func_span_id.go index 123b193b19238..74f9ee910ad5e 100644 --- a/pkg/ottl/ottlfuncs/func_span_id.go +++ b/pkg/ottl/ottlfuncs/func_span_id.go @@ -14,7 +14,7 @@ import ( ) type SpanIDArguments[K any] struct { - Bytes []byte `ottlarg:"0"` + Bytes []byte } func NewSpanIDFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_split.go b/pkg/ottl/ottlfuncs/func_split.go index b80c951df16e3..24e45fcb5c09f 100644 --- a/pkg/ottl/ottlfuncs/func_split.go +++ b/pkg/ottl/ottlfuncs/func_split.go @@ -12,8 +12,8 @@ import ( ) type SplitArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` - Delimiter string `ottlarg:"1"` + Target ottl.StringGetter[K] + Delimiter string } func NewSplitFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_substring.go b/pkg/ottl/ottlfuncs/func_substring.go index b1658a8dc6080..974a110b8716c 100644 --- a/pkg/ottl/ottlfuncs/func_substring.go +++ b/pkg/ottl/ottlfuncs/func_substring.go @@ -11,9 +11,9 @@ import ( ) type SubstringArguments[K any] struct { - Target ottl.StringGetter[K] `ottlarg:"0"` - Start ottl.IntGetter[K] `ottlarg:"1"` - Length ottl.IntGetter[K] `ottlarg:"2"` + Target ottl.StringGetter[K] + Start ottl.IntGetter[K] + Length ottl.IntGetter[K] } func NewSubstringFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_time.go b/pkg/ottl/ottlfuncs/func_time.go index 93202675772d8..427069eb2cdb1 100644 --- a/pkg/ottl/ottlfuncs/func_time.go +++ b/pkg/ottl/ottlfuncs/func_time.go @@ -12,8 +12,8 @@ import ( ) type TimeArguments[K any] struct { - Time ottl.StringGetter[K] `ottlarg:"0"` - Format string `ottlarg:"1"` + Time ottl.StringGetter[K] + Format string } func NewTimeFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_trace_id.go b/pkg/ottl/ottlfuncs/func_trace_id.go index b016303603388..c28013b75ab21 100644 --- a/pkg/ottl/ottlfuncs/func_trace_id.go +++ b/pkg/ottl/ottlfuncs/func_trace_id.go @@ -14,7 +14,7 @@ import ( ) type TraceIDArguments[K any] struct { - Bytes []byte `ottlarg:"0"` + Bytes []byte } func NewTraceIDFactory[K any]() ottl.Factory[K] { diff --git a/pkg/ottl/ottlfuncs/func_truncate_all.go b/pkg/ottl/ottlfuncs/func_truncate_all.go index 5196476a8b3fc..5d1a7fc083653 100644 --- a/pkg/ottl/ottlfuncs/func_truncate_all.go +++ b/pkg/ottl/ottlfuncs/func_truncate_all.go @@ -13,8 +13,8 @@ import ( ) type TruncateAllArguments[K any] struct { - Target ottl.PMapGetter[K] `ottlarg:"0"` - Limit int64 `ottlarg:"1"` + Target ottl.PMapGetter[K] + Limit int64 } func NewTruncateAllFactory[K any]() ottl.Factory[K] {