Documentation ¶
Index ¶
- Constants
- Variables
- func CLIFlags(envPrefix string) []cli.Flag
- func LaunchBalanceMetrics(ctx context.Context, log log.Logger, r *prometheus.Registry, ns string, ...)
- func ListenAndServe(ctx context.Context, r *prometheus.Registry, hostname string, port int) error
- func NewHTTPRecordingMiddleware(rec HTTPRecorder, next http.Handler) http.Handler
- func NewRegistry() *prometheus.Registry
- type CLIConfig
- type DocumentedMetric
- type Factory
- type HTTPParams
- type HTTPRecorder
- type NodeRecorder
- type PromHTTPRecorder
- func (p *PromHTTPRecorder) RecordHTTPRequest(params *HTTPParams)
- func (p *PromHTTPRecorder) RecordHTTPRequestDuration(params *HTTPParams, dur time.Duration)
- func (p *PromHTTPRecorder) RecordHTTPResponse(params *HTTPParams)
- func (p *PromHTTPRecorder) RecordHTTPResponseSize(params *HTTPParams, size int)
- func (p *PromHTTPRecorder) RecordInflightRequest(params *HTTPParams, quantity int)
- type PromNodeRecorder
Constants ¶
View Source
const ( EnabledFlagName = "metrics.enabled" ListenAddrFlagName = "metrics.addr" PortFlagName = "metrics.port" )
Variables ¶
View Source
var NoopHTTPRecorder = new(noopHTTPRecorder)
View Source
var NoopNodeRecorder = new(noopNodeRecorder)
Functions ¶
func LaunchBalanceMetrics ¶
func LaunchBalanceMetrics(ctx context.Context, log log.Logger, r *prometheus.Registry, ns string, client *ethclient.Client, account common.Address)
LaunchBalanceMetrics fires off a go rountine that queries the balance of the supplied account & periodically records it to the balance metric of the namespace. The balance of the account is recorded in Ether (not Wei). Cancel the supplied context to shut down the go routine
func ListenAndServe ¶
func NewHTTPRecordingMiddleware ¶
func NewHTTPRecordingMiddleware(rec HTTPRecorder, next http.Handler) http.Handler
func NewRegistry ¶
func NewRegistry() *prometheus.Registry
Types ¶
type DocumentedMetric ¶ added in v0.10.11
type Factory ¶ added in v0.10.11
type Factory interface { NewCounter(opts prometheus.CounterOpts) prometheus.Counter NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge NewGaugeVec(opts prometheus.GaugeOpts, labelNames []string) *prometheus.GaugeVec NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram NewHistogramVec(opts prometheus.HistogramOpts, labelNames []string) *prometheus.HistogramVec NewSummary(opts prometheus.SummaryOpts) prometheus.Summary NewSummaryVec(opts prometheus.SummaryOpts, labelNames []string) *prometheus.SummaryVec Document() []DocumentedMetric }
func With ¶ added in v0.10.11
func With(registry *prometheus.Registry) Factory
type HTTPParams ¶
type HTTPRecorder ¶
type HTTPRecorder interface { RecordHTTPRequestDuration(params *HTTPParams, dur time.Duration) RecordHTTPResponseSize(params *HTTPParams, size int) RecordInflightRequest(params *HTTPParams, quantity int) RecordHTTPRequest(params *HTTPParams) RecordHTTPResponse(params *HTTPParams) }
func NewPromHTTPRecorder ¶
func NewPromHTTPRecorder(r *prometheus.Registry, ns string) HTTPRecorder
type NodeRecorder ¶
type NodeRecorder interface { RecordUp() RecordInfo(version string) }
func NewPromNodeRecorder ¶
func NewPromNodeRecorder(r *prometheus.Registry, ns string) NodeRecorder
type PromHTTPRecorder ¶
type PromHTTPRecorder struct { HTTPRequestDuration *prometheus.HistogramVec HTTPResponseSize *prometheus.HistogramVec HTTPInflightRequests *prometheus.GaugeVec HTTPRequests *prometheus.CounterVec HTTPResponses *prometheus.CounterVec }
func (*PromHTTPRecorder) RecordHTTPRequest ¶
func (p *PromHTTPRecorder) RecordHTTPRequest(params *HTTPParams)
func (*PromHTTPRecorder) RecordHTTPRequestDuration ¶
func (p *PromHTTPRecorder) RecordHTTPRequestDuration(params *HTTPParams, dur time.Duration)
func (*PromHTTPRecorder) RecordHTTPResponse ¶
func (p *PromHTTPRecorder) RecordHTTPResponse(params *HTTPParams)
func (*PromHTTPRecorder) RecordHTTPResponseSize ¶
func (p *PromHTTPRecorder) RecordHTTPResponseSize(params *HTTPParams, size int)
func (*PromHTTPRecorder) RecordInflightRequest ¶
func (p *PromHTTPRecorder) RecordInflightRequest(params *HTTPParams, quantity int)
type PromNodeRecorder ¶
type PromNodeRecorder struct { Up prometheus.Gauge Info *prometheus.GaugeVec }
func (*PromNodeRecorder) RecordInfo ¶
func (p *PromNodeRecorder) RecordInfo(version string)
func (*PromNodeRecorder) RecordUp ¶
func (p *PromNodeRecorder) RecordUp()
Click to show internal directories.
Click to hide internal directories.