@@ -20,7 +20,12 @@ import (
20
20
// The passed in functions should use the ottlspan.TransformContext.
21
21
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
22
22
func NewBoolExprForSpan (conditions []string , functions map [string ]ottl.Factory [ottlspan.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottlspan.TransformContext ], error ) {
23
- parser , err := ottlspan .NewParser (functions , set )
23
+ return NewBoolExprForSpanWithOptions (conditions , functions , errorMode , set , nil )
24
+ }
25
+
26
+ // NewBoolExprForSpanWithOptions is like NewBoolExprForSpan, but with additional options.
27
+ func NewBoolExprForSpanWithOptions (conditions []string , functions map [string ]ottl.Factory [ottlspan.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottlspan.Option ) (* ottl.ConditionSequence [ottlspan.TransformContext ], error ) {
28
+ parser , err := ottlspan .NewParser (functions , set , parserOptions ... )
24
29
if err != nil {
25
30
return nil , err
26
31
}
@@ -36,7 +41,12 @@ func NewBoolExprForSpan(conditions []string, functions map[string]ottl.Factory[o
36
41
// The passed in functions should use the ottlspanevent.TransformContext.
37
42
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
38
43
func NewBoolExprForSpanEvent (conditions []string , functions map [string ]ottl.Factory [ottlspanevent.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottlspanevent.TransformContext ], error ) {
39
- parser , err := ottlspanevent .NewParser (functions , set )
44
+ return NewBoolExprForSpanEventWithOptions (conditions , functions , errorMode , set , nil )
45
+ }
46
+
47
+ // NewBoolExprForSpanEventWithOptions is like NewBoolExprForSpanEvent, but with additional options.
48
+ func NewBoolExprForSpanEventWithOptions (conditions []string , functions map [string ]ottl.Factory [ottlspanevent.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottlspanevent.Option ) (* ottl.ConditionSequence [ottlspanevent.TransformContext ], error ) {
49
+ parser , err := ottlspanevent .NewParser (functions , set , parserOptions ... )
40
50
if err != nil {
41
51
return nil , err
42
52
}
@@ -52,7 +62,12 @@ func NewBoolExprForSpanEvent(conditions []string, functions map[string]ottl.Fact
52
62
// The passed in functions should use the ottlmetric.TransformContext.
53
63
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
54
64
func NewBoolExprForMetric (conditions []string , functions map [string ]ottl.Factory [ottlmetric.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottlmetric.TransformContext ], error ) {
55
- parser , err := ottlmetric .NewParser (functions , set )
65
+ return NewBoolExprForMetricWithOptions (conditions , functions , errorMode , set , nil )
66
+ }
67
+
68
+ // NewBoolExprForMetricWithOptions is like NewBoolExprForMetric, but with additional options.
69
+ func NewBoolExprForMetricWithOptions (conditions []string , functions map [string ]ottl.Factory [ottlmetric.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottlmetric.Option ) (* ottl.ConditionSequence [ottlmetric.TransformContext ], error ) {
70
+ parser , err := ottlmetric .NewParser (functions , set , parserOptions ... )
56
71
if err != nil {
57
72
return nil , err
58
73
}
@@ -68,7 +83,12 @@ func NewBoolExprForMetric(conditions []string, functions map[string]ottl.Factory
68
83
// The passed in functions should use the ottldatapoint.TransformContext.
69
84
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
70
85
func NewBoolExprForDataPoint (conditions []string , functions map [string ]ottl.Factory [ottldatapoint.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottldatapoint.TransformContext ], error ) {
71
- parser , err := ottldatapoint .NewParser (functions , set )
86
+ return NewBoolExprForDataPointWithOptions (conditions , functions , errorMode , set , nil )
87
+ }
88
+
89
+ // NewBoolExprForDataPointWithOptions is like NewBoolExprForDataPoint, but with additional options.
90
+ func NewBoolExprForDataPointWithOptions (conditions []string , functions map [string ]ottl.Factory [ottldatapoint.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottldatapoint.Option ) (* ottl.ConditionSequence [ottldatapoint.TransformContext ], error ) {
91
+ parser , err := ottldatapoint .NewParser (functions , set , parserOptions ... )
72
92
if err != nil {
73
93
return nil , err
74
94
}
@@ -84,7 +104,12 @@ func NewBoolExprForDataPoint(conditions []string, functions map[string]ottl.Fact
84
104
// The passed in functions should use the ottllog.TransformContext.
85
105
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
86
106
func NewBoolExprForLog (conditions []string , functions map [string ]ottl.Factory [ottllog.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottllog.TransformContext ], error ) {
87
- parser , err := ottllog .NewParser (functions , set )
107
+ return NewBoolExprForLogWithOptions (conditions , functions , errorMode , set , nil )
108
+ }
109
+
110
+ // NewBoolExprForLogWithOptions is like NewBoolExprForLog, but with additional options.
111
+ func NewBoolExprForLogWithOptions (conditions []string , functions map [string ]ottl.Factory [ottllog.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottllog.Option ) (* ottl.ConditionSequence [ottllog.TransformContext ], error ) {
112
+ parser , err := ottllog .NewParser (functions , set , parserOptions ... )
88
113
if err != nil {
89
114
return nil , err
90
115
}
@@ -100,7 +125,12 @@ func NewBoolExprForLog(conditions []string, functions map[string]ottl.Factory[ot
100
125
// The passed in functions should use the ottlresource.TransformContext.
101
126
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
102
127
func NewBoolExprForResource (conditions []string , functions map [string ]ottl.Factory [ottlresource.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottlresource.TransformContext ], error ) {
103
- parser , err := ottlresource .NewParser (functions , set )
128
+ return NewBoolExprForResourceWithOptions (conditions , functions , errorMode , set , nil )
129
+ }
130
+
131
+ // NewBoolExprForResourceWithOptions is like NewBoolExprForResource, but with additional options.
132
+ func NewBoolExprForResourceWithOptions (conditions []string , functions map [string ]ottl.Factory [ottlresource.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottlresource.Option ) (* ottl.ConditionSequence [ottlresource.TransformContext ], error ) {
133
+ parser , err := ottlresource .NewParser (functions , set , parserOptions ... )
104
134
if err != nil {
105
135
return nil , err
106
136
}
@@ -116,7 +146,12 @@ func NewBoolExprForResource(conditions []string, functions map[string]ottl.Facto
116
146
// The passed in functions should use the ottlresource.TransformContext.
117
147
// If a function named `match` is not present in the function map it will be added automatically so that parsing works as expected
118
148
func NewBoolExprForScope (conditions []string , functions map [string ]ottl.Factory [ottlscope.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings ) (* ottl.ConditionSequence [ottlscope.TransformContext ], error ) {
119
- parser , err := ottlscope .NewParser (functions , set )
149
+ return NewBoolExprForScopeWithOptions (conditions , functions , errorMode , set , nil )
150
+ }
151
+
152
+ // NewBoolExprForScopeWithOptions is like NewBoolExprForScope, but with additional options.
153
+ func NewBoolExprForScopeWithOptions (conditions []string , functions map [string ]ottl.Factory [ottlscope.TransformContext ], errorMode ottl.ErrorMode , set component.TelemetrySettings , parserOptions []ottlscope.Option ) (* ottl.ConditionSequence [ottlscope.TransformContext ], error ) {
154
+ parser , err := ottlscope .NewParser (functions , set , parserOptions ... )
120
155
if err != nil {
121
156
return nil , err
122
157
}
0 commit comments