File tree Expand file tree Collapse file tree
container/config-generator/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ server {
4242 server_name <%= env!('HOSTNAME') %> ;
4343<% end %>
4444
45+ <% if env?('OPENTELEMETRY_ENABLED') -%>
46+ otel_trace on;
47+ otel_trace_context propagate;
48+ otel_span_name "$request_method $request_uri";
49+ <% end -%>
50+
4551 location = /graphql {
4652 proxy_pass http://sagittarius_rails_web;
4753 proxy_set_header Host $host;
Original file line number Diff line number Diff line change 1+ <% if env?('OPENTELEMETRY_ENABLED') -%>
2+ otel_exporter {
3+ endpoint <%= env!('OPENTELEMETRY_GRPC_HOST') %> ;
4+ interval 5s;
5+ batch_size 512;
6+ batch_count 4;
7+ }
8+
9+ otel_service_name <%= env('OPENTELEMETRY_SERVICE_NAME_NGINX', 'nginx') %> ;
10+ <% end -%>
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ VELORUM_JWT_SECRET=088cfc7a7fc2b07696d8ee5e1ea9d642
7272
7373# OpenTelemetry
7474OPENTELEMETRY_ENABLED = false
75+ OPENTELEMETRY_GRPC_HOST = http://localhost:4317
7576OPENTELEMETRY_LOGS_HTTP_ENDPOINT = http://localhost:4318/v1/logs
7677OPENTELEMETRY_METRICS_HTTP_ENDPOINT = http://localhost:4318/v1/metrics
7778OPENTELEMETRY_TRACES_HTTP_ENDPOINT = http://localhost:4318/v1/traces
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ services:
128128 - ide_velorum
129129
130130 nginx :
131- image : nginx:1.31.1-alpine-slim
131+ image : nginx:1.31.1-alpine-otel
132132 depends_on :
133133 config-generator :
134134 condition : service_completed_successfully
@@ -146,6 +146,10 @@ services:
146146 entrypoint : |
147147 sh -c "
148148 cp /tmp/generated-configs/nginx.default.conf /etc/nginx/conf.d/default.conf
149+ if [ -s /tmp/generated-configs/nginx.otel.conf ]; then
150+ sed -i '1i load_module modules/ngx_otel_module.so;' /etc/nginx/nginx.conf
151+ cp /tmp/generated-configs/nginx.otel.conf /etc/nginx/conf.d/otel.conf
152+ fi
149153 nginx -t
150154 exec nginx -g 'daemon off;'
151155 "
You can’t perform that action at this time.
0 commit comments