Enable ingress gateways to be traced
When tracing is on, the only way to include ingress gateways is by
having this custom header. Once that's done, the gateway is included
in the trace
@@ -7,6 +7,9 @@ export const apiFetchReq = async (urlSlug: string, method = "GET") => {
credentials: "include",
headers: new Headers({
"Content-Type": "application/json",
+ // 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",
}),
}).catch((e) => {
console.warn(e);
@@ -22,6 +25,9 @@ export const apiPostRequestWithBody = async (urlSlug: string, body: string) => {
credentials: "include",
headers: new Headers({
"Content-Type": "application/json",
+ // 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",
}),
body: body,
}).catch((e) => {
