From f473996c70c6682f96bbffcd79153f1bdd72266f Mon Sep 17 00:00:00 2001 From: Alex Buchanan Date: Fri, 25 Oct 2024 13:59:09 -0700 Subject: [PATCH] docs: note about segment context handling in http request --- internal/telemetry/segment.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/telemetry/segment.go b/internal/telemetry/segment.go index 6ca0e39..589e725 100644 --- a/internal/telemetry/segment.go +++ b/internal/telemetry/segment.go @@ -150,6 +150,8 @@ func (s *SegmentClient) send(ctx context.Context, es EventState, et EventType, e return fmt.Errorf("unable to create request body: %w", err) } + // We don't include the parent context in the http request, + // because we want to send telemetry even if the parent context is canceled. req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(data)) if err != nil { return fmt.Errorf("unable to create request: %w", err)