Skip to content

Commit

Permalink
Add support for monitoring the origin load balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Johnston committed Oct 7, 2023
1 parent abb222d commit 9908ffb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions blog-app/src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
{{ serverInfo().node }}
{{ serverInfo().slot }}
{{ serverInfo().version }}
{{ serverInfo().lb }}
</p>
2 changes: 1 addition & 1 deletion blog-app/src/app/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class FooterComponent implements OnInit {
if (!JoelJConstants.isServer)
return (window as any).serverInfo;
else
return { node: "ssr", slot: "ssr", version: "ssr" };
return { node: "ssr", slot: "ssr", version: "ssr", lb: "ssr" };
}

}
3 changes: 2 additions & 1 deletion blog-app/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
const originNode = ('; '+document.cookie).split(`; originnode=`).pop().split(';')[0];
const decodedOriginNode = decodeURI(originNode);
const serverParts = decodedOriginNode.split(' ');
window.serverInfo = { node: serverParts[0], slot: serverParts[1], version: serverParts[2] }
const originLb = ('; '+document.cookie).split(`; originlb=`).pop().split(';')[0];
window.serverInfo = { node: serverParts[0], slot: serverParts[1], version: serverParts[2], lb: originLb }
}
</script>
</head>
Expand Down
1 change: 1 addition & 0 deletions gateway/joeljca.site.blue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ server {

location / {
proxy_pass http://joeljcablue;
add_header Set-Cookie "originlb=${hostname}; Path=/";
}
}

Expand Down
1 change: 1 addition & 0 deletions gateway/joeljca.site.green
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ server {

location / {
proxy_pass http://joeljcagreen;
add_header Set-Cookie "originlb=${hostname}; Path=/";
}
}

Expand Down

0 comments on commit 9908ffb

Please sign in to comment.