Documentation ¶
Overview ¶
Package opa provides prometheus metrics for OPA and methods
Index ¶
- func ExportConstraintInformation(ci *prometheus.Desc, constraints []Constraint) []prometheus.Metric
- func ExportViolations(ctx context.Context, cv *prometheus.Desc, constraints []Constraint) []prometheus.Metric
- type Constraint
- type ConstraintMeta
- type ConstraintSpec
- type ConstraintStatus
- type Exporter
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportConstraintInformation ¶
func ExportConstraintInformation(ci *prometheus.Desc, constraints []Constraint) []prometheus.Metric
func ExportViolations ¶
func ExportViolations(ctx context.Context, cv *prometheus.Desc, constraints []Constraint) []prometheus.Metric
Types ¶
type Constraint ¶
type Constraint struct { Meta ConstraintMeta Spec ConstraintSpec Status ConstraintStatus }
func GetConstraints ¶
func GetConstraints(ctx context.Context, inCluster *bool) ([]Constraint, error)
GetConstraints returns a list of all OPA constraints nolint:gocognit // would be nice to reduce complexity - I don't see a straightforward path ATM.
type ConstraintMeta ¶
ConstraintMeta represents meta information of a constraint
type ConstraintSpec ¶
type ConstraintSpec struct {
EnforcementAction string `json:"enforcementAction"`
}
ConstraintSpec collect general information about the overall constraints applied to the cluster
type ConstraintStatus ¶
type Exporter ¶
type Exporter struct { ConstraintInformation *prometheus.Desc ConstraintViolation *prometheus.Desc Metrics []prometheus.Metric Namespace string Up *prometheus.Desc }
func NewExporter ¶
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Click to show internal directories.
Click to hide internal directories.