Documentation ¶
Index ¶
- func BuildStatic(gauges []StaticGauge) []prometheus.Collector
- type ClientMetrics
- type Cosmos
- func (c *Cosmos) IncValSignedBlocks(chain, consaddress string)
- func (c *Cosmos) Metrics() []prometheus.Collector
- func (c *Cosmos) SetAccountBalance(chain, alias, address, denom string, balance float64)
- func (c *Cosmos) SetNodeHeight(chain string, height float64)
- func (c *Cosmos) SetValJailStatus(chain, consaddress string, status cosmos.JailStatus)
- func (c *Cosmos) SetValMissedBlocks(chain, consaddress string, missed float64)
- func (c *Cosmos) SetValSignedBlock(chain, consaddress string, height float64)
- func (c *Cosmos) SetValSlashingParams(chain string, window float64)
- type FallbackClient
- type Internal
- type StaticGauge
- type StaticSample
- type Task
- type TaskErrorMetrics
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStatic ¶
func BuildStatic(gauges []StaticGauge) []prometheus.Collector
BuildStatic returns static metrics
Types ¶
type ClientMetrics ¶
type Cosmos ¶
type Cosmos struct {
// contains filtered or unexported fields
}
Cosmos records metrics for Cosmos chains
func (*Cosmos) IncValSignedBlocks ¶
IncValSignedBlocks increments the number of blocks signed by validator at consaddress.
func (*Cosmos) Metrics ¶
func (c *Cosmos) Metrics() []prometheus.Collector
Metrics returns all metrics for Cosmos chains to be added to a Prometheus registry.
func (*Cosmos) SetAccountBalance ¶
SetAccountBalance records the balance of an account for a given denom.
func (*Cosmos) SetNodeHeight ¶
SetNodeHeight records the block height on the public_rpc_node_height gauge.
func (*Cosmos) SetValJailStatus ¶
func (c *Cosmos) SetValJailStatus(chain, consaddress string, status cosmos.JailStatus)
SetValJailStatus records the jailed status of a validator. In this context, "active" does not mean part of the validator active set, only that the validator is not jailed.
func (*Cosmos) SetValMissedBlocks ¶
SetValMissedBlocks sets the number of missed blocks within the slashing window for a validator.
func (*Cosmos) SetValSignedBlock ¶
SetValSignedBlock sets latest signed block height for a validator.
func (*Cosmos) SetValSlashingParams ¶
SetValSlashingParams sets the slashing window for all validators on the chain. Extend this method to set other slashing parameters.
type FallbackClient ¶
type FallbackClient struct {
// contains filtered or unexported fields
}
func NewFallbackClient ¶
func NewFallbackClient(client *http.Client, metrics ClientMetrics, hosts []url.URL) *FallbackClient
type Internal ¶
type Internal struct {
// contains filtered or unexported fields
}
Internal records metrics that represent the health of sl-exporter itself.
func NewInternal ¶
func NewInternal() *Internal
func (Internal) IncAPIError ¶
IncAPIError increments the number of errors encountered while making external API calls.
func (Internal) IncFailedTask ¶
IncFailedTask increments the number of failed sl-exporter tasks.
func (Internal) Metrics ¶
func (c Internal) Metrics() []prometheus.Collector
type StaticGauge ¶
type StaticGauge struct { Name string Description string Labels []string Samples []StaticSample }
type StaticSample ¶
type TaskErrorMetrics ¶
type TaskErrorMetrics interface {
IncFailedTask(group string)
}
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool runs tasks at intervals.
func NewWorkerPool ¶
func NewWorkerPool(tasks []Task, numWorkers int, metrics TaskErrorMetrics) (*WorkerPool, error)
NewWorkerPool creates a new worker pool.
func (*WorkerPool) Start ¶
func (w *WorkerPool) Start(ctx context.Context)
Start continuously runs tasks at intervals until the context is canceled.