Skip to content

Commit

Permalink
docs: note about segment context handling in http request
Browse files Browse the repository at this point in the history
  • Loading branch information
abuchanan-airbyte committed Oct 25, 2024
1 parent 51ab44b commit f473996
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/telemetry/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f473996

Please sign in to comment.