From e8514f1eb38b70fd481d118434fe22eb72a9ae75 Mon Sep 17 00:00:00 2001 From: "mojo-machine[bot]" <111131124+mojo-machine[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 15:14:44 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20Sync=20from=20monorepo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/wearemojo/mojo/commit/8d3dca671b6836f8d6ae48732f410a51d031b92f --- lib/otelmiddleware/headers.go | 2 +- lib/otelmiddleware/util.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/otelmiddleware/headers.go b/lib/otelmiddleware/headers.go index 508ba3d..d07d25b 100644 --- a/lib/otelmiddleware/headers.go +++ b/lib/otelmiddleware/headers.go @@ -31,7 +31,7 @@ func TraceIDWithGCPURLs(gcpProjectID string) func(next http.Handler) http.Handle if traceID != "" { res.Header().Set(headerKeyID, traceID) res.Header().Set(headerKeyURL, getGCPTraceURL(gcpProjectID, traceID)) - res.Header().Set(headerKeyLogsURL, getGCPTraceLogsURL(gcpProjectID, traceID, time.Now())) + res.Header().Set(headerKeyLogsURL, GetGCPTraceLogsURL(gcpProjectID, traceID, time.Now())) } next.ServeHTTP(res, req) diff --git a/lib/otelmiddleware/util.go b/lib/otelmiddleware/util.go index d28b3a2..b4bb5ee 100644 --- a/lib/otelmiddleware/util.go +++ b/lib/otelmiddleware/util.go @@ -36,7 +36,7 @@ func getGCPTraceURL(gcpProjectID, traceID string) string { return fmt.Sprintf("%s/traces/list?%s", gcpBaseURL, params.Encode()) } -func getGCPTraceLogsURL(gcpProjectID, traceID string, refTime time.Time) string { +func GetGCPTraceLogsURL(gcpProjectID, traceID string, refTime time.Time) string { tracePath := getGCPTracePath(gcpProjectID, traceID) query := fmt.Sprintf("(trace=\"%s\" OR labels.\"appengine.googleapis.com/trace_id\"=\"%s\")", tracePath, traceID) timeRange := fmt.Sprintf("%s/%s--PT15M", refTime.Format(time.RFC3339), refTime.Format(time.RFC3339))