MCPcopy
hub / github.com/crowdsecurity/crowdsec / bumpNodeMetric

Method bumpNodeMetric

pkg/parser/node.go:530–545  ·  view source on GitHub ↗
(counter *prometheus.CounterVec, p *pipeline.Event)

Source from the content-addressed store, hash-verified

528}
529
530func (n *Node) bumpNodeMetric(counter *prometheus.CounterVec, p *pipeline.Event) {
531 // better safe than sorry
532 acquisType := p.Line.Labels["type"]
533 if acquisType == "" {
534 acquisType = "unknown"
535 }
536
537 labels := prometheus.Labels{
538 "source": p.Line.Src,
539 "type": p.Line.Module,
540 "name": n.Name,
541 "stage": p.Stage,
542 "acquis_type": acquisType,
543 }
544 counter.With(labels).Inc()
545}

Callers 1

processMethod · 0.95

Calls 2

IncMethod · 0.80
WithMethod · 0.45

Tested by

no test coverage detected