| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
mod bounded_set; |
| 5 |
mod compatibility; |
| 6 |
pub(crate) mod counter; |
| 7 |
pub mod detector; |
| 8 |
#[cfg(feature = "fuzzing")] |
| 9 |
pub mod parsing; |
| 10 |
#[cfg(not(feature = "fuzzing"))] |
| 11 |
mod parsing; |
| 12 |
mod record; |
| 13 |
pub mod subscriber; |
| 14 |
pub mod telemetry_sink; |
| 15 |
#[cfg(test)] |
| 16 |
mod test_utils; |
| 17 |
|
| 18 |
pub use detector::SyntheticTrafficDetector; |
| 19 |
pub use subscriber::AggregatedMetricsSubscriber; |
| 20 |
pub use telemetry_sink::TelemetrySink; |
| 21 |
|
| 22 |
|
| 23 |
#[derive(Debug, Clone, PartialEq, Eq, Default)] |
| 24 |
pub struct Attribution { |
| 25 |
|
| 26 |
pub service: String, |
| 27 |
|
| 28 |
pub resource: String, |
| 29 |
|
| 30 |
|
| 31 |
pub component: String, |
| 32 |
} |
| 33 |
|
| 34 |
impl Attribution { |
| 35 |
pub(crate) fn into_schema(self) -> s2n_tls_metrics_schema::attribution::Attribution { |
| 36 |
s2n_tls_metrics_schema::attribution::Attribution { |
| 37 |
service: self.service, |
| 38 |
resource: self.resource, |
| 39 |
component: self.component, |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
#[derive(Debug, Clone)] |
| 54 |
pub struct MetricRecord(s2n_tls_metrics_schema::record::MetricRecord); |
| 55 |
|
| 56 |
impl MetricRecord { |
| 57 |
pub(crate) fn new(inner: s2n_tls_metrics_schema::record::MetricRecord) -> Self { |
| 58 |
Self(inner) |
| 59 |
} |
| 60 |
|
| 61 |
#[cfg(test)] |
| 62 |
pub(crate) fn as_schema(&self) -> &s2n_tls_metrics_schema::record::MetricRecord { |
| 63 |
&self.0 |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
impl serde::Serialize for MetricRecord { |
| 68 |
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { |
| 69 |
self.0.serialize(serializer) |
| 70 |
} |
| 71 |
} |
| 72 |
|
| 73 |
impl metrique_writer::Entry for MetricRecord { |
| 74 |
fn write<'a>(&'a self, writer: &mut impl metrique_writer::EntryWriter<'a>) { |
| 75 |
self.0.write(writer) |
| 76 |
} |
| 77 |
} |