Skip to content

Commit 22f02e1

Browse files
committed
Reduce timeout
1 parent 7b475f9 commit 22f02e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sloggers/slogstackdriver/slogstackdriver.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ import (
2626
func Sink(w io.Writer) slog.Sink {
2727
// When not running in Google Cloud, the default metadata client will
2828
// leak a goroutine.
29+
//
30+
// We use a very short timeout because the metadata server should be
31+
// within the same datacenter as the cloud instance.
2932
client := metadata.NewClient(&http.Client{
30-
Timeout: time.Second * 5,
33+
Timeout: time.Second * 3,
3134
})
3235
projectID, _ := client.ProjectID()
3336

0 commit comments

Comments
 (0)