metrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandlerPath                  = "/metrics-co"
	ControllerMetricsServiceName = "metrics-co"
	ControllerMetricsPort        = 8585
	MetricsAddrListen            = ":8585"
)
View Source
const (
	METRIC_STATE_COMPLIANT = iota
	METRIC_STATE_NON_COMPLIANT
	METRIC_STATE_INCONSISTENT
	METRIC_STATE_ERROR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerMetrics

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

func DefaultControllerMetrics

func DefaultControllerMetrics() *ControllerMetrics

type Metrics

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

Metrics is the main structure of this package.

func New

func New() *Metrics

New returns a new default Metrics instance.

func NewMetrics

func NewMetrics(imp impl) *Metrics

func (*Metrics) IncComplianceRemediationStatus

func (m *Metrics) IncComplianceRemediationStatus(name string, status v1alpha1.ComplianceRemediationStatus)

IncComplianceRemediationStatus increments the ComplianceRemediation status counter

func (*Metrics) IncComplianceScanStatus

func (m *Metrics) IncComplianceScanStatus(name string, status v1alpha1.ComplianceScanStatus)

IncComplianceScanStatus also increments error if necessary

func (*Metrics) Register

func (m *Metrics) Register() error

Register iterates over all available metrics and registers them.

func (*Metrics) SetComplianceStateError

func (m *Metrics) SetComplianceStateError(name string)

SetComplianceStateError sets the compliance_state gauge to 3.

func (*Metrics) SetComplianceStateInCompliance

func (m *Metrics) SetComplianceStateInCompliance(name string)

SetComplianceStateInCompliance sets the compliance_state gauge to 0.

func (*Metrics) SetComplianceStateInconsistent

func (m *Metrics) SetComplianceStateInconsistent(name string)

SetComplianceStateInconsistent sets the compliance_state gauge to 2.

func (*Metrics) SetComplianceStateOutOfCompliance

func (m *Metrics) SetComplianceStateOutOfCompliance(name string)

SetComplianceStateOutOfCompliance sets the compliance_state gauge to 1.

func (*Metrics) Start

func (m *Metrics) Start(ctx context.Context) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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