types

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package types provides shared types for the Effectiveness Monitor.

Business Requirements: - BR-EM-001 through BR-EM-008: Core EM assessment types - BR-AUDIT-006: Audit event types for SOC 2 compliance

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEventType

type AuditEventType string

AuditEventType identifies the type of audit event emitted by EM. Per DD-AUDIT-CORRELATION-002: Each component emits its own audit event.

const (
	// AuditHealthAssessed is emitted when health check completes.
	AuditHealthAssessed AuditEventType = "effectiveness.health.assessed"
	// AuditHashComputed is emitted when spec hash comparison completes.
	AuditHashComputed AuditEventType = "effectiveness.hash.computed"
	// AuditAlertAssessed is emitted when alert resolution check completes.
	AuditAlertAssessed AuditEventType = "effectiveness.alert.assessed"
	// AuditMetricsAssessed is emitted when metric comparison completes.
	AuditMetricsAssessed AuditEventType = "effectiveness.metrics.assessed"
	// AuditAssessmentScheduled is emitted on first reconciliation with derived timing (BR-EM-009.4).
	AuditAssessmentScheduled AuditEventType = "effectiveness.assessment.scheduled"
	// AuditAssessmentCompleted is emitted when the full assessment finishes.
	AuditAssessmentCompleted AuditEventType = "effectiveness.assessment.completed"
	// AuditAlertDecayDetected is emitted once when the EM first detects alert decay
	// (resource healthy but alert still firing). Subsequent re-checks are silent.
	// Reference: Issue #369, BR-EM-012
	AuditAlertDecayDetected AuditEventType = "effectiveness.alert_decay.detected"
)

func AuditEventTypeForComponent

func AuditEventTypeForComponent(component string) AuditEventType

AuditEventTypeForComponent returns the audit event type for a given component name.

type ComponentResult

type ComponentResult struct {
	// Component identifies which check produced this result.
	Component ComponentType
	// Assessed indicates whether this component was successfully evaluated.
	Assessed bool
	// Score is the component score (0.0-1.0), nil if not assessed.
	Score *float64
	// Details provides human-readable details about the assessment.
	Details string
	// Error captures any error that occurred during assessment.
	Error error
}

ComponentResult represents the outcome of a single assessment component.

type ComponentType

type ComponentType string

ComponentType identifies which assessment component produced a result.

const (
	// ComponentHealth is the K8s health check component (BR-EM-001).
	ComponentHealth ComponentType = "health"
	// ComponentAlert is the AlertManager resolution check component (BR-EM-002).
	ComponentAlert ComponentType = "alert"
	// ComponentMetrics is the Prometheus metric comparison component (BR-EM-003).
	ComponentMetrics ComponentType = "metrics"
	// ComponentHash is the spec hash comparison component (BR-EM-004).
	ComponentHash ComponentType = "hash"
	// ComponentAlertDecay is the alert decay detection pseudo-component (BR-EM-012).
	ComponentAlertDecay ComponentType = "alert_decay"
)

Jump to

Keyboard shortcuts

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