Skip to content

Commit

Permalink
set X-Cloud-Trace-Context header on prober requests to help log corre…
Browse files Browse the repository at this point in the history
…lation (#977)

Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway authored Feb 5, 2024
1 parent f6cca14 commit 1e9c666
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/prober/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1e9c666

Please sign in to comment.