Documentation ¶
Index ¶
- Constants
- func DefaultRequestsCounter(meter metric.Meter, histogramName string) (metric.Int64Counter, error)
- func DefaultSecondsHistogram(meter metric.Meter, histogramName string) (metric.Float64Histogram, error)
- func DefaultSecondsHistogramView(histogramName string) metricsdk.View
- func ParseProxy(proxy string) (*url.URL, error)
- type Client
- type ClientOptions
- func WithClientOptionsCheckRedirect(cf func(req *http.Request, via []*http.Request) error) ClientOptions
- func WithClientOptionsJar(jar http.CookieJar) ClientOptions
- func WithClientOptionsTimeout(timeout time.Duration) ClientOptions
- func WithClientOptionsTransport(transport http.RoundTripper) ClientOptions
- func WithMeterProvider(mr metric.MeterProvider) ClientOptions
- func WithTraceProvider(tr trace.TracerProvider) ClientOptions
- type DoOptionsWithRecordSize
- type IClient
- type IDoOptions
Constants ¶
View Source
const ( DefaultClientSecondsHistogramName = "client_requests_seconds_bucket" DefaultClientRequestsCounterName = "client_requests_code_total" )
Variables ¶
This section is empty.
Functions ¶
func DefaultRequestsCounter ¶
DefaultRequestsCounter return metric.Int64Counter for WithRequests suggest histogramName = <client/server>_requests_code_total
func DefaultSecondsHistogram ¶
func DefaultSecondsHistogram(meter metric.Meter, histogramName string) (metric.Float64Histogram, error)
DefaultSecondsHistogram return metric.Float64Histogram for WithSeconds suggest histogramName = <client/server>_requests_seconds_bucket
func DefaultSecondsHistogramView ¶
DefaultSecondsHistogramView need register in sdkmetric.MeterProvider eg: view := SecondsHistogramView() mp := sdkmetric.NewMeterProvider(sdkmetric.WithView(view)) otel.SetMeterProvider(mp)
Types ¶
type ClientOptions ¶
type ClientOptions func(client *Client)
func WithClientOptionsJar ¶
func WithClientOptionsJar(jar http.CookieJar) ClientOptions
func WithClientOptionsTimeout ¶
func WithClientOptionsTimeout(timeout time.Duration) ClientOptions
func WithClientOptionsTransport ¶
func WithClientOptionsTransport(transport http.RoundTripper) ClientOptions
func WithMeterProvider ¶
func WithMeterProvider(mr metric.MeterProvider) ClientOptions
func WithTraceProvider ¶
func WithTraceProvider(tr trace.TracerProvider) ClientOptions
type DoOptionsWithRecordSize ¶
type DoOptionsWithRecordSize struct {
// contains filtered or unexported fields
}
func NewDoOptionsWithRecordSize ¶
func NewDoOptionsWithRecordSize(size uint32) *DoOptionsWithRecordSize
type IClient ¶
type IClient interface {
Do(ctx context.Context, request *http.Request, opts ...IDoOptions) (*http.Response, error)
}
func NewClient ¶
func NewClient(opts ...ClientOptions) (IClient, error)
type IDoOptions ¶
type IDoOptions interface {
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.