Skip to content

Commit

Permalink
🔄 Sync from monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
mojo-machine[bot] committed May 30, 2024
1 parent cbc1750 commit e8514f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/otelmiddleware/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/otelmiddleware/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e8514f1

Please sign in to comment.