1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! `/debug/schema` summary response contracts.
//!
//! This module owns the aggregate health summary payload type independently
//! from summary metric computation logic.
use serde::Serialize;
/// One machine-readable reason contributing to overall debug health.
#[derive(Debug, Clone, Serialize)]
pub struct LoggingSchemaDebugHealthReason {
/// Stable reason code (`missing_required_tables`, etc.).
pub code: String,
/// Severity classification for this reason (`info`, `warning`, `error`).
pub severity: String,
/// Count associated with this reason.
pub count: usize,
/// Human-readable explanation for operators.
pub message: String,
}
/// Health aggregate for `/debug/schema` diagnostics.
#[derive(Debug, Clone, Serialize)]
pub struct LoggingSchemaDebugSummary {
/// Overall health status (`healthy`, `warning`, `degraded`, or `unhealthy`).
pub health: String,
/// Structured reasons explaining why the current health status was assigned.
pub health_reasons: Vec<LoggingSchemaDebugHealthReason>,
/// Number of expected table specs.
pub expected_table_count: usize,
/// Number of expected tables that were found.
pub found_table_count: usize,
/// Number of required tables that were not found.
pub required_missing_table_count: usize,
/// Number of optional tables that were not found.
pub optional_missing_table_count: usize,
/// Number of required columns that were not found.
pub required_missing_column_count: usize,
/// Number of optional columns that were not found.
pub optional_missing_column_count: usize,
/// Number of expected relations whose discovered relation type mismatched.
pub relation_type_mismatch_count: usize,
}