Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions helm/config/default.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
split_clients "$otel_trace_id" $ratio_sampler {
{{ .Values.opentelemetry.ratio }}% on;
* off;
}

server {
listen 8080;
server_name localhost;
Expand All @@ -12,9 +7,6 @@ server {
include /etc/nginx/conf.d/{{ .Values.nginx.additionalConf.fileName }};
{{- end }}

# Include OpenTelemetry tracing configuration
{{ include "nginx.otelTrace" . | nindent 4 }}

# In case you use "add_header" in the location block, these "add_header" will be ignored!
add_header 'Access-Control-Max-Age' '{{ .Values.nginx.maxAge | default "7200" }}';
add_header 'Access-Control-Allow-Origin' {{ .Values.nginx.allowedOrigins | default "*" | squote }};
Expand Down
2 changes: 2 additions & 0 deletions helm/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ events {


http {
{{ include "nginx.otelRatioSampler" . | nindent 4 }}
{{ include "nginx.otelTrace" . | nindent 4 }}
Comment thread
almog8k marked this conversation as resolved.
otel_service_name {{ .Values.opentelemetry.serviceName }};
otel_exporter {
endpoint {{ .Values.opentelemetry.exporterHost }}:{{ .Values.opentelemetry.exporterPort }};
Expand Down
10 changes: 10 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ Returns the port for NGINX Prometheus Exporter
{{ toJson $subPathsList }}
{{- end -}}

{{/*
Generate OpenTelemetry ratio sampler split_clients block
*/}}
{{- define "nginx.otelRatioSampler" -}}
split_clients "$otel_trace_id" $ratio_sampler {
{{ .Values.opentelemetry.ratio }}% on;
* off;
}
{{- end -}}

{{/*
Generate OpenTelemetry trace configuration
*/}}
Expand Down
Loading