File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -1010,6 +1010,24 @@ var directives = map[string][]uint{
1010
1010
ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1234 ,
1011
1011
ngxStreamMainConf | ngxStreamSrvConf | ngxConfTake1234 ,
1012
1012
},
1013
+ "otel_exporter" : {
1014
+ ngxHTTPMainConf | ngxConfBlock | ngxConfNoArgs ,
1015
+ },
1016
+ "otel_service_name" : {
1017
+ ngxHTTPMainConf | ngxConfTake1 ,
1018
+ },
1019
+ "otel_span_attr" : {
1020
+ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake2 ,
1021
+ },
1022
+ "otel_span_name" : {
1023
+ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1 ,
1024
+ },
1025
+ "otel_trace" : {
1026
+ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1 ,
1027
+ },
1028
+ "otel_trace_context" : {
1029
+ ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake1 ,
1030
+ },
1013
1031
"output_buffers" : {
1014
1032
ngxHTTPMainConf | ngxHTTPSrvConf | ngxHTTPLocConf | ngxConfTake2 ,
1015
1033
},
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ var mapBodies = map[string]mapParameterMasks{
41
41
"geoip2" : {
42
42
defaultMasks : ngxConf1More ,
43
43
},
44
+ "otel_exporter" : {
45
+ defaultMasks : ngxConfTake1 ,
46
+ },
44
47
}
45
48
46
49
// analyzeMapBody validates the body of a map-like directive. Map-like directives are block directives
Original file line number Diff line number Diff line change @@ -175,6 +175,27 @@ func TestAnalyzeMapBody(t *testing.T) {
175
175
},
176
176
term : ";" ,
177
177
},
178
+ "valid otel_exporter" : {
179
+ mapDirective : "otel_exporter" ,
180
+ parameter : & Directive {
181
+ Directive : "endpoint" ,
182
+ Args : []string {"localhost:4317" },
183
+ Line : 5 ,
184
+ Block : Directives {},
185
+ },
186
+ term : ";" ,
187
+ },
188
+ "invalid otel_exporter" : {
189
+ mapDirective : "otel_exporter" ,
190
+ parameter : & Directive {
191
+ Directive : "endpoint" ,
192
+ Args : []string {"localhost:4317" , "localhost:1234" },
193
+ Line : 5 ,
194
+ Block : Directives {},
195
+ },
196
+ term : ";" ,
197
+ wantErr : & ParseError {What : "invalid number of parameters" , BlockCtx : "otel_exporter" },
198
+ },
178
199
"missing semicolon" : {
179
200
mapDirective : "map" ,
180
201
parameter : & Directive {
You can’t perform that action at this time.
0 commit comments