Documentation ¶
Index ¶
- Constants
- type ControllerMetrics
- type Metrics
- func (m *Metrics) IncComplianceRemediationStatus(name string, status v1alpha1.ComplianceRemediationStatus)
- func (m *Metrics) IncComplianceScanStatus(name string, status v1alpha1.ComplianceScanStatus)
- func (m *Metrics) Register() error
- func (m *Metrics) SetComplianceStateError(name string)
- func (m *Metrics) SetComplianceStateInCompliance(name string)
- func (m *Metrics) SetComplianceStateInconsistent(name string)
- func (m *Metrics) SetComplianceStateOutOfCompliance(name string)
- func (m *Metrics) Start(ctx context.Context) error
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 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) SetComplianceStateError ¶
SetComplianceStateError sets the compliance_state gauge to 3.
func (*Metrics) SetComplianceStateInCompliance ¶
SetComplianceStateInCompliance sets the compliance_state gauge to 0.
func (*Metrics) SetComplianceStateInconsistent ¶
SetComplianceStateInconsistent sets the compliance_state gauge to 2.
func (*Metrics) SetComplianceStateOutOfCompliance ¶
SetComplianceStateOutOfCompliance sets the compliance_state gauge to 1.
Click to show internal directories.
Click to hide internal directories.