Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientWrapper ¶
type ClientWrapper struct {
// contains filtered or unexported fields
}
ClientWrapper wraps an HTTP client with metrics instrumentation.
func NewClientWrapper ¶
NewClientWrapper creates a new HTTP client wrapper with metrics.
func (*ClientWrapper) Client ¶
func (c *ClientWrapper) Client() *http.Client
Client returns the underlying HTTP client.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics for API connections.
func NewMetrics ¶
NewMetrics creates a new API metrics instance.
func (*Metrics) ObserveAPIRequestDuration ¶
ObserveAPIRequestDuration records the duration of an API request.
func (*Metrics) RecordAPIError ¶
RecordAPIError increments the API error counter.
func (*Metrics) RecordAPIRequest ¶
RecordAPIRequest increments the API request counter.
func (*Metrics) SetRateLimitRemaining ¶
SetRateLimitRemaining sets the remaining rate limit for a service.
type MetricsRoundTripper ¶
type MetricsRoundTripper struct {
// contains filtered or unexported fields
}
MetricsRoundTripper is an http.RoundTripper that collects metrics.
func NewMetricsRoundTripper ¶
func NewMetricsRoundTripper(next http.RoundTripper, metrics *Metrics, log *logrus.Logger, opts ...RoundTripperOption) *MetricsRoundTripper
NewMetricsRoundTripper creates a new metrics-collecting round tripper.
type RoundTripperOption ¶
type RoundTripperOption func(*MetricsRoundTripper)
RoundTripperOption is a function that configures a MetricsRoundTripper.
func WithService ¶
func WithService(service string) RoundTripperOption
WithService sets the service name for the MetricsRoundTripper.