Skip to content

Commit

Permalink
It works! Maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg committed Feb 3, 2023
1 parent 7ad30c0 commit 660a385
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 25 deletions.
6 changes: 5 additions & 1 deletion load-balancer-otel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ RUN apt-get update \

COPY consul-template-config.hcl .
COPY nginx.ctmpl /usr/templates/nginx.ctmpl
COPY opentelemetry_module.conf /etc/nginx/conf.d
COPY opentelemetry_module.conf /etc/nginx/conf.d/

EXPOSE 80

STOPSIGNAL SIGQUIT

CMD ["dumb-init", "consul-template", "-config=consul-template-config.hcl"]
2 changes: 1 addition & 1 deletion load-balancer-otel/consul-template-config.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ consul {
}
template {
source = "/usr/templates/nginx.ctmpl"
destination = "/etc/nginx/nginx.conf"
destination = "/etc/nginx/conf.d/default.conf"
perms = 0600
command = "if [ -e /var/run/nginx.pid ]; then nginx -s reload; else nginx; fi"
}
34 changes: 11 additions & 23 deletions load-balancer-otel/nginx.ctmpl
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
load_module /opt/opentelemetry-webserver-sdk/WebServerModule/Nginx/1.23.1/ngx_http_opentelemetry_module.so;

worker_processes 1;

events {
worker_connections 1024;
upstream messenger_service {
{{- range service "messenger" }}
server {{ .Address }}:{{ .Port }};
{{- end }}
# server backup1.example.com backup;
}

http {
keepalive_timeout 65;

upstream messenger_service {
{{- range service "messenger" }}
server {{ .Address }}:{{ .Port }};
{{- end }}
# server backup1.example.com backup;
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://messenger_service;
}
}
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://messenger_service;
}
}

0 comments on commit 660a385

Please sign in to comment.