Skip to content

Commit 4cf0f62

Browse files
pdabelf5haywoodsh
authored andcommitted
update templates to add OSS support
1 parent 283c3d8 commit 4cf0f62

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

internal/configs/version1/nginx-plus.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,18 +149,18 @@ http {
149149
{{- if .MainOtelLoadModule}}
150150
otel_exporter {
151151
endpoint {{ .MainOtelExporterEndpoint}};
152-
{{ if and .MainOtelExporterHeaderName .MainOtelExporterHeaderValue }}
152+
{{- if and .MainOtelExporterHeaderName .MainOtelExporterHeaderValue }}
153153
header {{ .MainOtelExporterHeaderName }} "{{ .MainOtelExporterHeaderValue }}";
154154
{{- end }}
155-
{{ if .MainOtelExporterTrustedCA}}
155+
{{- if .MainOtelExporterTrustedCA}}
156156
# trusted_certificate <path>;
157157
{{- end }}
158158
}
159159

160-
{{ if .MainOtelServiceName}}
160+
{{- if .MainOtelServiceName}}
161161
otel_service_name {{ .MainOtelServiceName }};
162162
{{- end }}
163-
{{ if .MainOtelGlobalTraceEnabled }}
163+
{{- if .MainOtelGlobalTraceEnabled }}
164164
otel_trace on;
165165
{{- end}}
166166
{{- end}}

internal/configs/version1/nginx.tmpl

+23
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ daemon off;
1111
error_log stderr {{.ErrorLogLevel}};
1212
pid /var/lib/nginx/nginx.pid;
1313

14+
{{- if .MainOtelLoadModule}}
15+
load_module modules/ngx_otel_module.so;
16+
{{- end}}
17+
1418
{{- if .MainSnippets}}
1519
{{range $value := .MainSnippets}}
1620
{{$value}}{{end}}
@@ -104,6 +108,25 @@ http {
104108
ssl_dhparam {{.SSLDHParam}};
105109
{{- end}}
106110

111+
{{- if .MainOtelLoadModule}}
112+
otel_exporter {
113+
endpoint {{ .MainOtelExporterEndpoint}};
114+
{{- if and .MainOtelExporterHeaderName .MainOtelExporterHeaderValue }}
115+
header {{ .MainOtelExporterHeaderName }} "{{ .MainOtelExporterHeaderValue }}";
116+
{{- end }}
117+
{{- if .MainOtelExporterTrustedCA}}
118+
# trusted_certificate <path>;
119+
{{- end }}
120+
}
121+
122+
{{- if .MainOtelServiceName}}
123+
otel_service_name {{ .MainOtelServiceName }};
124+
{{- end }}
125+
{{- if .MainOtelGlobalTraceEnabled }}
126+
otel_trace on;
127+
{{- end}}
128+
{{- end}}
129+
107130
server {
108131
# required to support the Websocket protocol in VirtualServer/VirtualServerRoutes
109132
set $default_connection_header "";

0 commit comments

Comments
 (0)