sentryhttpclient

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 4 Imported by: 6 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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