Class: Woods::Observability::HealthCheck
- Inherits:
-
Object
- Object
- Woods::Observability::HealthCheck
- Defined in:
- lib/woods/observability/health_check.rb
Overview
Probes configured components and reports overall system health.
Checks vector store, metadata store, and embedding provider by calling lightweight operations on each. Components that are nil are reported as :not_configured and do not affect the overall healthy? status.
Defined Under Namespace
Classes: HealthStatus
Instance Method Summary collapse
-
#initialize(vector_store: nil, metadata_store: nil, embedding_provider: nil) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
-
#run ⇒ HealthStatus
Run health probes on all configured components.
Constructor Details
#initialize(vector_store: nil, metadata_store: nil, embedding_provider: nil) ⇒ HealthCheck
Returns a new instance of HealthCheck.
28 29 30 31 32 |
# File 'lib/woods/observability/health_check.rb', line 28 def initialize(vector_store: nil, metadata_store: nil, embedding_provider: nil) @vector_store = vector_store @metadata_store = @embedding_provider = end |
Instance Method Details
#run ⇒ HealthStatus
Run health probes on all configured components.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/woods/observability/health_check.rb', line 37 def run components = { vector_store: probe_store(@vector_store), metadata_store: probe_store(@metadata_store), embedding_provider: probe_provider(@embedding_provider) } all_healthy = components.values.all? { |status| %i[ok not_configured].include?(status) } HealthStatus.new(healthy?: all_healthy, components: components) end |