Enable ig traces for service worker requests
Instrument service worker requests so we can see what's going on when
there's a problem
@@ -106,7 +106,12 @@ function registerValidSW(swUrl: string, config?: Config) {
function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
- headers: { "Service-Worker": "script" },
+ headers: {
+ "Service-Worker": "script",
+ // Enable Consul Ingress Gateway tracing with custom header per Consideration 2 of
+ // https://www.consul.io/docs/connect/distributed-tracing#considerations
+ "x-client-trace-id": "1",
+ },
})
.then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
