Documentation
¶
Index ¶
- Constants
- type Config
- type DocumentedMetric
- type Factory
- type Metricer
- type Metrics
- func (m *Metrics) DecActivePipelines(pipelineType core.PipelineType, network core.Network)
- func (m *Metrics) Document() []DocumentedMetric
- func (m *Metrics) IncActiveInvariants(invType core.InvariantType, network core.Network, ...)
- func (m *Metrics) IncActivePipelines(pipelineType core.PipelineType, network core.Network)
- func (m *Metrics) RecordAlertGenerated(alert core.Alert)
- func (m *Metrics) RecordBlockLatency(network core.Network, latency float64)
- func (m *Metrics) RecordInvExecutionError(inv invariant.Invariant)
- func (m *Metrics) RecordInvExecutionTime(inv invariant.Invariant, latency float64)
- func (m *Metrics) RecordInvariantRun(inv invariant.Invariant)
- func (m *Metrics) RecordNodeError(network core.Network)
- func (m *Metrics) RecordPipelineLatency(pUUID core.PUUID, latency float64)
- func (m *Metrics) RecordUp()
- func (m *Metrics) Shutdown(ctx context.Context) error
- func (m *Metrics) Start()
Constants ¶
const ( SummaryType = "summary" HistogramType = "histogram" GaugeType = "gauge" CounterType = "counter" )
const ( SubsystemInvariants = "invariants" SubsystemEtl = "etl" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentedMetric ¶
type Factory ¶
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 ¶
func With(registry *prometheus.Registry) Factory
type Metricer ¶
type Metricer interface {
IncActiveInvariants(invType core.InvariantType, network core.Network, pipelineType core.PipelineType)
IncActivePipelines(pipelineType core.PipelineType, network core.Network)
DecActivePipelines(pipelineType core.PipelineType, network core.Network)
RecordBlockLatency(network core.Network, latency float64)
RecordInvariantRun(invariant invariant.Invariant)
RecordAlertGenerated(alert core.Alert)
RecordNodeError(network core.Network)
RecordPipelineLatency(pUUID core.PUUID, latency float64)
RecordInvExecutionError(inv invariant.Invariant)
RecordInvExecutionTime(inv invariant.Invariant, latency float64)
RecordUp()
Start()
Shutdown(ctx context.Context) error
Document() []DocumentedMetric
}
func WithContext ¶
WithContext returns a Metricer from the given context. If no Metricer is found, the default noopMetricer is returned.
type Metrics ¶
type Metrics struct {
Up prometheus.Gauge
ActivePipelines *prometheus.GaugeVec
ActiveInvariants *prometheus.GaugeVec
InvariantRuns *prometheus.CounterVec
AlertsGenerated *prometheus.CounterVec
NodeErrors *prometheus.CounterVec
BlockLatency *prometheus.GaugeVec
PipelineLatency *prometheus.GaugeVec
InvExecutionTime *prometheus.GaugeVec
InvariantErrors *prometheus.CounterVec
// contains filtered or unexported fields
}
func (*Metrics) DecActivePipelines ¶
func (m *Metrics) DecActivePipelines(pipelineType core.PipelineType, network core.Network)
DecActivePipelines ... Decrements the number of active pipelines
func (*Metrics) Document ¶
func (m *Metrics) Document() []DocumentedMetric
Document ... Returns a list of documented metrics
func (*Metrics) IncActiveInvariants ¶
func (m *Metrics) IncActiveInvariants(invType core.InvariantType, network core.Network, pipelineType core.PipelineType)
IncActiveInvariants ... Increments the number of active invariants
func (*Metrics) IncActivePipelines ¶
func (m *Metrics) IncActivePipelines(pipelineType core.PipelineType, network core.Network)
IncActivePipelines ... Increments the number of active pipelines
func (*Metrics) RecordAlertGenerated ¶
RecordAlertGenerated ... Records that an alert has been generated for a given invariant
func (*Metrics) RecordBlockLatency ¶
RecordBlockLatency ... Records the latency of block processing
func (*Metrics) RecordInvExecutionError ¶
RecordInvExecutionError ... Increments the number of errors generated by invariant executions
func (*Metrics) RecordInvExecutionTime ¶
RecordInvExecutionTime ... Records the time it took to execute an invariant
func (*Metrics) RecordInvariantRun ¶
RecordInvariantRun ... Records that a given invariant has been run
func (*Metrics) RecordNodeError ¶
RecordNodeError ... Records that an error has been caught for a given node
func (*Metrics) RecordPipelineLatency ¶
RecordPipelineLatency ... Records the latency of pipeline processing
func (*Metrics) RecordUp ¶
func (m *Metrics) RecordUp()
RecordUp ... Records that the service has been successfully started