myc_http_tools/models/
api_otel_codes.rs

1use serde::Serialize;
2use std::fmt::Display;
3
4/// This enum contains the telemetry codes for the API crate telemetry
5///
6/// See below the list of telemetry prefixes:
7///
8/// - END: Endpoint
9/// - MID: Middleware
10/// - ROUTE: Route
11/// - HC: Health Check
12///
13#[derive(Clone, Debug, Serialize)]
14#[serde(untagged, rename_all = "UPPERCASE")]
15pub enum APIOtelCodes {
16    /// Health Check
17    ///
18    /// Used on start the health check dispatcher.
19    ///
20    HC00001 = 1,
21
22    /// Health Check dispatcher cicle start
23    ///
24    /// Dispached when a new health check dispatcher cicle is started.
25    ///
26    HC00002,
27
28    /// Health Check dispatcher cicle end
29    ///
30    /// Dispached when a health check dispatcher cicle is finished.
31    ///
32    HC00003,
33
34    /// Single service health check start
35    ///
36    /// Dispached when a single service health check is started.
37    ///
38    HC00004,
39
40    /// Single service health check end
41    ///
42    /// Dispached when a single service health check is finished.
43    ///
44    HC00005,
45
46    /// Single host health check start
47    ///
48    /// Dispached when a single host health check is started.
49    ///
50    HC00006,
51
52    /// Single host health check end
53    ///
54    /// Dispached when a single host health check is finished.
55    ///
56    HC00007,
57}
58
59impl Display for APIOtelCodes {
60    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
61        write!(f, "{:?}", self)
62    }
63}