Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
RequestCount metric.Int64Counter
RequestDuration metric.Float64Histogram
}
Metrics holds the instruments the webhook source records, mirroring the names, descriptions and units of the Python MetricsMiddleware.
func NewMetrics ¶
func NewMetrics(mp metric.MeterProvider) (*Metrics, error)
NewMetrics builds the instruments from a meter provider. Passing a nil or noop provider yields instruments that record nothing, so the request path needs no nil checks.
type Option ¶
type Option func(*Source)
func WithLogger ¶
func WithMeterProvider ¶
func WithMeterProvider(mp metric.MeterProvider) Option
WithMeterProvider records request metrics against the given provider. A nil provider leaves the source recording nothing.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) Addr ¶
Addr reports the bound address, which only differs from the configured one when the port was left to the kernel.
func (*Source) HMACConfig ¶
HMACConfig reports the signature validation in effect, nil when bodies are accepted unvalidated.