From 90b93c1ac961f6baaead8ccf58bd220e81dc1879 Mon Sep 17 00:00:00 2001 From: Bob Callaway Date: Mon, 5 Feb 2024 10:24:22 -0500 Subject: [PATCH] set X-Cloud-Trace-Context header on prober requests to help log correlation Signed-off-by: Bob Callaway --- cmd/prober/write.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/prober/write.go b/cmd/prober/write.go index 32b72f660..dbc864ac6 100644 --- a/cmd/prober/write.go +++ b/cmd/prober/write.go @@ -31,6 +31,7 @@ import ( "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" + "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus" retryablehttp "github.com/hashicorp/go-retryablehttp" @@ -63,6 +64,8 @@ func setHeaders(req *retryablehttp.Request, token string) { // Set the content-type to reflect we're sending JSON. req.Header.Set("Content-Type", "application/json") req.Header.Set("User-Agent", fmt.Sprintf("Sigstore_Scaffolding_Prober/%s", versionInfo.GitVersion)) + // Set this value (even though it is not coming through an GCP LB) to correlate prober req/response + req.Header.Set("X-Cloud-Trace-Context", uuid.Must(uuid.NewV7()).String()) } // fulcioWriteEndpoint tests the only write endpoint for Fulcio