oxigdal_observability/
error.rs1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, ObservabilityError>;
7
8#[derive(Debug, Error)]
10pub enum ObservabilityError {
11 #[error("Failed to initialize telemetry: {0}")]
13 TelemetryInit(String),
14
15 #[error("Invalid telemetry configuration: {0}")]
17 InvalidConfig(String),
18
19 #[error("Configuration error: {0}")]
21 ConfigError(String),
22
23 #[error("Failed to export metrics: {0}")]
25 MetricsExportFailed(String),
26
27 #[error("Failed to export traces: {0}")]
29 TraceExportFailed(String),
30
31 #[error("Failed to create span: {0}")]
33 SpanCreationFailed(String),
34
35 #[error("Failed to propagate context: {0}")]
37 ContextPropagationFailed(String),
38
39 #[error("Failed to connect to exporter: {0}")]
41 ExporterConnectionFailed(String),
42
43 #[error("Invalid metric value: {0}")]
45 InvalidMetricValue(String),
46
47 #[error("Failed to route alert: {0}")]
49 AlertRoutingFailed(String),
50
51 #[error("Alert deduplication error: {0}")]
53 AlertDeduplicationError(String),
54
55 #[error("SLO calculation error: {0}")]
57 SloCalculationError(String),
58
59 #[error("Anomaly detection error: {0}")]
61 AnomalyDetectionError(String),
62
63 #[error("Failed to generate dashboard: {0}")]
65 DashboardGenerationFailed(String),
66
67 #[error("IO error: {0}")]
69 Io(#[from] std::io::Error),
70
71 #[error("Serialization error: {0}")]
73 Serialization(#[from] serde_json::Error),
74
75 #[error("HTTP error: {0}")]
77 Http(#[from] reqwest::Error),
78
79 #[error("URL parse error: {0}")]
81 UrlParse(#[from] url::ParseError),
82
83 #[error("Operation timed out")]
85 Timeout,
86
87 #[error("Resource not found: {0}")]
89 NotFound(String),
90
91 #[error("Other error: {0}")]
93 Other(String),
94}