metrics

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package metrics provides Prometheus metrics for the minecraft-operator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopRecorder

type NoopRecorder struct{}

NoopRecorder is a no-op implementation of Recorder for use in tests.

func (*NoopRecorder) RecordPluginAPICall

func (n *NoopRecorder) RecordPluginAPICall(_ string, _ error, _ time.Duration)

func (*NoopRecorder) RecordReconcile

func (n *NoopRecorder) RecordReconcile(_ string, _ error, _ time.Duration)

func (*NoopRecorder) RecordSolverRun

func (n *NoopRecorder) RecordSolverRun(_ string, _ error, _ time.Duration)

func (*NoopRecorder) RecordUpdate

func (n *NoopRecorder) RecordUpdate(_ bool)

type PrometheusRecorder

type PrometheusRecorder struct {
	// contains filtered or unexported fields
}

PrometheusRecorder implements Recorder using Prometheus metrics.

func NewPrometheusRecorder

func NewPrometheusRecorder(reg prometheus.Registerer) *PrometheusRecorder

NewPrometheusRecorder creates a PrometheusRecorder and registers all metrics with the provided prometheus.Registerer.

func (*PrometheusRecorder) RecordPluginAPICall

func (r *PrometheusRecorder) RecordPluginAPICall(source string, err error, duration time.Duration)

func (*PrometheusRecorder) RecordReconcile

func (r *PrometheusRecorder) RecordReconcile(controller string, err error, duration time.Duration)

func (*PrometheusRecorder) RecordSolverRun

func (r *PrometheusRecorder) RecordSolverRun(solverType string, err error, duration time.Duration)

func (*PrometheusRecorder) RecordUpdate

func (r *PrometheusRecorder) RecordUpdate(success bool)

type Recorder

type Recorder interface {
	// RecordReconcile records a reconciliation loop completion.
	RecordReconcile(controller string, err error, duration time.Duration)

	// RecordPluginAPICall records a plugin repository API call.
	RecordPluginAPICall(source string, err error, duration time.Duration)

	// RecordSolverRun records a constraint solver invocation.
	RecordSolverRun(solverType string, err error, duration time.Duration)

	// RecordUpdate records a server update attempt.
	RecordUpdate(success bool)
}

Recorder defines the interface for recording operator metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL