Documentation
¶
Overview ¶
Package prometheus provides a reference MetricsRecorder implementation using Prometheus. Copy this file into your own codebase and adjust as needed.
**Important:** this example must be updated whenever the `metrics.Recorder` interface changes. The method names used here match the interface defined in `metrics/recorder.go`.
Index ¶
- type PrometheusRecorder
- func (p *PrometheusRecorder) RecordClaimAttempt(streamName string, success bool, duration time.Duration)
- func (p *PrometheusRecorder) RecordKspNotification(streamName string)
- func (p *PrometheusRecorder) RecordKspNotificationDropped()
- func (p *PrometheusRecorder) RecordLockAcquisitionAttempt(streamName string, success bool, duration time.Duration)
- func (p *PrometheusRecorder) RecordLockExtensionAttempt(streamName string, success bool)
- func (p *PrometheusRecorder) RecordLockReleaseAttempt(streamName string, success bool)
- func (p *PrometheusRecorder) RecordStartupRecovery(success bool, unackedCount int, duration time.Duration)
- func (p *PrometheusRecorder) RecordStreamProcessingEnd(streamName string, end time.Time)
- func (p *PrometheusRecorder) RecordStreamProcessingStart(streamName string, start time.Time)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrometheusRecorder ¶
type PrometheusRecorder struct {
// contains filtered or unexported fields
}
PrometheusRecorder is a MetricsRecorder implementation using Prometheus.
func NewPrometheusRecorder ¶
func NewPrometheusRecorder(reg prometheus.Registerer) *PrometheusRecorder
NewPrometheusRecorder creates a new PrometheusRecorder and registers all metrics with the provided Prometheus registerer.
func (*PrometheusRecorder) RecordClaimAttempt ¶
func (p *PrometheusRecorder) RecordClaimAttempt(streamName string, success bool, duration time.Duration)
func (*PrometheusRecorder) RecordKspNotification ¶
func (p *PrometheusRecorder) RecordKspNotification(streamName string)
func (*PrometheusRecorder) RecordKspNotificationDropped ¶
func (p *PrometheusRecorder) RecordKspNotificationDropped()
func (*PrometheusRecorder) RecordLockAcquisitionAttempt ¶
func (p *PrometheusRecorder) RecordLockAcquisitionAttempt(streamName string, success bool, duration time.Duration)
func (*PrometheusRecorder) RecordLockExtensionAttempt ¶
func (p *PrometheusRecorder) RecordLockExtensionAttempt(streamName string, success bool)
func (*PrometheusRecorder) RecordLockReleaseAttempt ¶
func (p *PrometheusRecorder) RecordLockReleaseAttempt(streamName string, success bool)
func (*PrometheusRecorder) RecordStartupRecovery ¶
func (p *PrometheusRecorder) RecordStartupRecovery(success bool, unackedCount int, duration time.Duration)
RecordStartupRecovery implements the interface method for startup recovery.
func (*PrometheusRecorder) RecordStreamProcessingEnd ¶
func (p *PrometheusRecorder) RecordStreamProcessingEnd(streamName string, end time.Time)
func (*PrometheusRecorder) RecordStreamProcessingStart ¶
func (p *PrometheusRecorder) RecordStreamProcessingStart(streamName string, start time.Time)
Click to show internal directories.
Click to hide internal directories.