## Complete Observability Stack (O1-O13) Implements all 13 observability issues in a single PR. 119 metrics total. ### Commits (one per issue) | Issue | Title | Metrics | |-------|-------|---------| | **O10** | Prometheus metrics module + /metrics endpoint | Foundation | | **O1** | Instrument ingest handler | I1-I12 (12) | | **O2** | Instrument query handler | Q1-Q12 (12) | | **O3** | Instrument context endpoint | C1-C8 (8) | | **O4** | Relevance judge | R1-R9 (9) | | **O5** | Write volume + storage metrics | W1-W12 (12) | | **O6** | Pod resource observability | P1-P13 | | **O7** | Availability + dependency health | A1-A10 (10) | | **O8** | Ingest rate pattern tracking | IR1-IR10 (10) | | **O9** | Postgres internal observability | PG1-PG33 | | **O11** | Grafana dashboard | 12 panels | | **O12** | Prometheus alerting rules | 11 alerts | | **O13** | Relevance evaluation CronJob | K8s manifest | ### Key Changes - **metrics.rs**: Zero-dependency Prometheus metrics (Counter, Gauge, Histogram, Timer) - **GET /metrics**: Prometheus text exposition format endpoint - **Ingest/Query/Context handlers**: Instrumented with latency, errors, auth failures - **Health check**: DB dependency check with latency tracking - **Background task**: Periodic DB stats collection (entity/edge counts, pool stats) - **Relevance judge**: Threshold-based eval with precision/recall/F1 tracking - **Grafana dashboard**: 12 panels covering all metric groups - **Alert rules**: 11 PrometheusRule alerts (availability, latency, errors, quality) - **CronJob**: Periodic relevance evaluation with sample queries ### Testing - 506 tests passing (0 failures) - All metrics modules have unit tests - Relevance judge: 4 tests ### Deploy ```bash # Grafana dashboard kubectl apply -f k8s/infra/grafana-dashboard.json # Prometheus alerts kubectl apply -f k8s/infra/prometheus-alerts.yaml # Relevance eval CronJob kubectl apply -f k8s/infra/relevance-eval-cronjob.yaml ``` Closes #27 #28 #29 #30 #31 #32 #33 #34 #35 #36 #37 #38 #39 --------- Co-authored-by: rock <[email protected]> Reviewed-on: #52 Co-authored-by: poimen <[email protected]>
57 lines
2.1 KiB
Rust
57 lines
2.1 KiB
Rust
pub mod endpoints;
|
|
pub mod handlers;
|
|
pub mod http_server;
|
|
pub mod metrics;
|
|
pub mod metrics_snapshot;
|
|
pub mod relevance_judge;
|
|
pub mod query;
|
|
pub mod auth;
|
|
pub mod ingest_worker;
|
|
pub mod query_worker;
|
|
pub mod rate_limiter;
|
|
pub mod idempotency;
|
|
pub mod jwt_validator;
|
|
pub mod opensearch_client;
|
|
pub mod dual_write_indexer;
|
|
pub mod queue_adapter;
|
|
pub mod gateway_queue_adapter;
|
|
pub mod queue_worker;
|
|
pub mod query_optimizer;
|
|
pub mod simple_hybrid_search;
|
|
pub mod accuracy_metrics;
|
|
pub mod context_endpoint;
|
|
pub mod verify;
|
|
pub mod rbac;
|
|
pub mod hybrid_retrieval;
|
|
pub mod chunk_optimizer;
|
|
pub mod chunk_metadata;
|
|
pub mod cache_alignment;
|
|
pub mod query_orchestrator;
|
|
pub mod query_filter;
|
|
pub mod advanced_ranking;
|
|
pub mod result_compressor;
|
|
pub mod federation;
|
|
pub mod query_router;
|
|
pub mod full_pipeline;
|
|
pub mod authorized_pipeline;
|
|
// pub mod ingest_with_persistence; // TODO: Fix db_repo integration
|
|
pub mod auth_middleware;
|
|
pub mod compaction;
|
|
pub mod compaction_executor;
|
|
pub mod agent;
|
|
pub mod parallel_dual_write;
|
|
|
|
pub use endpoints::{IngestQueue, IngestRequest, JobStatus};
|
|
pub use http_server::{AppState, AuthMode};
|
|
pub use ingest_worker::IngestWorker;
|
|
pub use query_worker::QueryWorker;
|
|
pub use hybrid_retrieval::{HybridRetriever, RetrievalRoute, WikiScopedFilter, RankedCandidate};
|
|
pub use chunk_optimizer::{ChunkOptimizer, OptimizableChunk, SelectionMetrics};
|
|
pub use chunk_metadata::{MetadataExtractor, MetadataBooster, ChunkMetadata, ChunkCategory, QueryIntent};
|
|
pub use cache_alignment::{LruChunkCache, KvCacheAligner, CacheLocalityAnalyzer, RetrievalProfiler, CacheMetrics};
|
|
pub use query_orchestrator::{QueryOrchestrator, QueryResult, OptimizedChunk, QueryContext, MemoryProjection};
|
|
pub use query_filter::{QueryFilter, FilterableDocument, FilterEngine, FilterStatistics};
|
|
pub use query_router::{QueryRouter, RouterConfig, RoutedResult, SelectedChunk, WikiGraphBuilder};
|
|
pub use full_pipeline::{FullPipeline, PipelineConfig, PipelineResult, PipelineMetrics, EnrichedChunk, PipelineBuilder};
|
|
pub use authorized_pipeline::{AuthorizedPipeline, AuthorizedPipelineBuilder, AuthorizedResult, AccessStats};
|