Documentation ¶
Index ¶
- Constants
- type Config
- type DocumentedMetric
- type Factory
- type Metricer
- type Metrics
- func (m *Metrics) DecActivePipelines(pt core.PipelineType, n core.Network)
- func (m *Metrics) Document() []DocumentedMetric
- func (m *Metrics) IncActiveHeuristics(ht core.HeuristicType, n core.Network, pipelineType core.PipelineType)
- func (m *Metrics) IncActivePipelines(pt core.PipelineType, n core.Network)
- func (m *Metrics) RecordAlertGenerated(alert core.Alert, dest core.AlertDestination, clientName string)
- func (m *Metrics) RecordAssessmentError(h heuristic.Heuristic)
- func (m *Metrics) RecordBlockLatency(n core.Network, latency float64)
- func (m *Metrics) RecordHeuristicRun(h heuristic.Heuristic)
- func (m *Metrics) RecordInvExecutionTime(h heuristic.Heuristic, latency float64)
- func (m *Metrics) RecordNodeError(n 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 ( SubsystemHeuristics = "heuristics" 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 { IncActiveHeuristics(ht core.HeuristicType, 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) RecordHeuristicRun(heuristic heuristic.Heuristic) RecordAlertGenerated(alert core.Alert, dest core.AlertDestination, clientName string) RecordNodeError(network core.Network) RecordPipelineLatency(pUUID core.PUUID, latency float64) RecordAssessmentError(h heuristic.Heuristic) RecordInvExecutionTime(h heuristic.Heuristic, 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 ActiveHeuristics *prometheus.GaugeVec HeuristicRuns *prometheus.CounterVec AlertsGenerated *prometheus.CounterVec NodeErrors *prometheus.CounterVec BlockLatency *prometheus.GaugeVec PipelineLatency *prometheus.GaugeVec InvExecutionTime *prometheus.GaugeVec HeuristicErrors *prometheus.CounterVec // contains filtered or unexported fields }
func (*Metrics) DecActivePipelines ¶
func (m *Metrics) DecActivePipelines(pt core.PipelineType, n 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) IncActiveHeuristics ¶ added in v1.0.0
func (m *Metrics) IncActiveHeuristics(ht core.HeuristicType, n core.Network, pipelineType core.PipelineType)
IncActiveHeuristics ... Increments the number of active heuristics
func (*Metrics) IncActivePipelines ¶
func (m *Metrics) IncActivePipelines(pt core.PipelineType, n core.Network)
IncActivePipelines ... Increments the number of active pipelines
func (*Metrics) RecordAlertGenerated ¶
func (m *Metrics) RecordAlertGenerated(alert core.Alert, dest core.AlertDestination, clientName string)
RecordAlertGenerated ... Records that an alert has been generated for a given heuristic
func (*Metrics) RecordAssessmentError ¶ added in v1.0.0
RecordAssessmentError ... Increments the number of errors generated by heuristic executions
func (*Metrics) RecordBlockLatency ¶
RecordBlockLatency ... Records the latency of block processing
func (*Metrics) RecordHeuristicRun ¶ added in v1.0.0
RecordHeuristicRun ... Records that a given heuristic has been run
func (*Metrics) RecordInvExecutionTime ¶
RecordInvExecutionTime ... Records the time it took to execute a heuristic
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