Documentation ¶
Overview ¶
Package metrics contains interfaces for reporting OpenCensus stats to a metrics backend, such as Prometheus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegisterEventProcessingStatsView ¶
func MustRegisterEventProcessingStatsView()
MustRegisterEventProcessingStatsView registers an OpenCensus stats view for metrics related to events processing, and panics in case of error.
func TagEventSource ¶
TagEventSource returns a tag mutator that injects the value of the "event_source" tag.
func TagEventType ¶
TagEventType returns a tag mutator that injects the value of the "event_type" tag.
Types ¶
type EventProcessingStatsReporter ¶
type EventProcessingStatsReporter struct {
// contains filtered or unexported fields
}
EventProcessingStatsReporter collects and reports stats about the processing of CloudEvents.
func MustNewEventProcessingStatsReporter ¶
func MustNewEventProcessingStatsReporter(tags *pkgadapter.MetricTag) *EventProcessingStatsReporter
MustNewEventProcessingStatsReporter returns a new EventProcessingStatsReporter initialized with the given tags and panics in case of error.
func (*EventProcessingStatsReporter) ReportProcessingError ¶
func (r *EventProcessingStatsReporter) ReportProcessingError(userManaged bool, tms ...tag.Mutator)
ReportProcessingError increments eventProcessingErrorCountM.
func (*EventProcessingStatsReporter) ReportProcessingLatency ¶
func (r *EventProcessingStatsReporter) ReportProcessingLatency(d time.Duration, tms ...tag.Mutator)
ReportProcessingLatency records in eventProcessingLatenciesM the processing duration of an event.
func (*EventProcessingStatsReporter) ReportProcessingSuccess ¶
func (r *EventProcessingStatsReporter) ReportProcessingSuccess(tms ...tag.Mutator)
ReportProcessingSuccess increments eventProcessingSuccessCountM.