File tree 3 files changed +13
-13
lines changed
internal/mode/static/nginx/config
3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ func TestGenerate(t *testing.T) {
95
95
g .Expect (httpCfg ).To (ContainSubstring ("upstream" ))
96
96
g .Expect (httpCfg ).To (ContainSubstring ("split_clients" ))
97
97
98
- g .Expect (httpCfg ).To (ContainSubstring (" endpoint 1.2.3.4:123;" ))
99
- g .Expect (httpCfg ).To (ContainSubstring (" interval 5s;" ))
98
+ g .Expect (httpCfg ).To (ContainSubstring (` endpoint " 1.2.3.4:123";` ))
99
+ g .Expect (httpCfg ).To (ContainSubstring (` interval "5s";` ))
100
100
g .Expect (httpCfg ).To (ContainSubstring ("batch_size 512;" ))
101
101
g .Expect (httpCfg ).To (ContainSubstring ("batch_count 4;" ))
102
- g .Expect (httpCfg ).To (ContainSubstring (" otel_service_name ngf:gw-ns:gw-name:my-name;" ))
102
+ g .Expect (httpCfg ).To (ContainSubstring (` otel_service_name " ngf:gw-ns:gw-name:my-name";` ))
103
103
104
104
g .Expect (files [2 ].Type ).To (Equal (file .TypeRegular ))
105
105
g .Expect (files [2 ].Path ).To (Equal ("/etc/nginx/conf.d/config-version.conf" ))
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ package config
2
2
3
3
const otelTemplateText = `
4
4
otel_exporter {
5
- endpoint {{ .Endpoint }};
5
+ endpoint " {{ .Endpoint }}" ;
6
6
{{- if .Interval }}
7
- interval {{ .Interval }};
7
+ interval " {{ .Interval }}" ;
8
8
{{- end }}
9
9
{{- if .BatchSize }}
10
10
batch_size {{ .BatchSize }};
@@ -14,9 +14,9 @@ otel_exporter {
14
14
{{- end }}
15
15
}
16
16
17
- otel_service_name {{ .ServiceName }};
17
+ otel_service_name " {{ .ServiceName }}" ;
18
18
19
19
{{- range $attr := .SpanAttributes }}
20
- otel_span_attr {{ $attr.Key }} {{ $attr.Value }};
20
+ otel_span_attr " {{ $attr.Key }}" " {{ $attr.Value }}" ;
21
21
{{- end }}
22
22
`
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ func TestExecuteTelemetry(t *testing.T) {
33
33
34
34
g := NewWithT (t )
35
35
expSubStrings := map [string ]int {
36
- " endpoint 1.2.3.4:123;" : 1 ,
37
- " otel_service_name ngf:gw-ns:gw-name:my-name;" : 1 ,
38
- " interval 5s;" : 1 ,
39
- "batch_size 512;" : 1 ,
40
- "batch_count 4;" : 1 ,
41
- "otel_span_attr" : 2 ,
36
+ ` endpoint " 1.2.3.4:123";` : 1 ,
37
+ ` otel_service_name " ngf:gw-ns:gw-name:my-name";` : 1 ,
38
+ ` interval "5s";` : 1 ,
39
+ "batch_size 512;" : 1 ,
40
+ "batch_count 4;" : 1 ,
41
+ "otel_span_attr" : 2 ,
42
42
}
43
43
44
44
for expSubStr , expCount := range expSubStrings {
You can’t perform that action at this time.
0 commit comments