sentryhttpclient

package
v0.41.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package sentryhttpclient provides Sentry integration for Requests modules to enable distributed tracing between services. It is compatible with `net/http.RoundTripper`.

import sentryhttpclient "github.com/getsentry/sentry-go/httpclient"

roundTrippper := sentryhttpclient.NewSentryRoundTripper(nil, nil)
client := &http.Client{
	Transport: roundTripper,
}

request, err := client.Do(request)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSentryRoundTripper

func NewSentryRoundTripper(originalRoundTripper http.RoundTripper, opts ...SentryRoundTripTracerOption) http.RoundTripper

NewSentryRoundTripper provides a wrapper to existing http.RoundTripper to have required span data and trace headers for outgoing HTTP requests.

  • If `nil` is passed to `originalRoundTripper`, it will use http.DefaultTransport instead.

Types

type SentryRoundTripTracerOption

type SentryRoundTripTracerOption func(*SentryRoundTripper)

SentryRoundTripTracerOption provides a specific type in which defines the option for SentryRoundTripper.

func WithTracePropagationTargets

func WithTracePropagationTargets(targets []string) SentryRoundTripTracerOption

WithTracePropagationTargets configures additional trace propagation targets URL for the RoundTripper. Does not support regex patterns.

type SentryRoundTripper

type SentryRoundTripper struct {
	// contains filtered or unexported fields
}

SentryRoundTripper provides a http.RoundTripper implementation for Sentry Requests module.

func (*SentryRoundTripper) RoundTrip

func (s *SentryRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL