Skip to main content

lmn_core/monitoring/
spans.rs

1/// Central registry of all tracing span names used in lmn.
2///
3/// Use the associated constants directly to get the right span name in a given context.
4pub struct SpanName;
5
6impl SpanName {
7    const PREFIX: &'static str = "lmn";
8
9    /// Root span covering the entire lmn run.
10    pub const RUN: &'static str = "lmn.run";
11
12    /// Span covering the full parse + validation of a request template file.
13    pub const TEMPLATE_PARSE: &'static str = "lmn.template.parse";
14
15    /// Span covering pre-generation of all request bodies from a template.
16    pub const TEMPLATE_RENDER: &'static str = "lmn.template.render";
17
18    /// Span covering placeholder validation during template parsing.
19    pub const TEMPLATE_VALIDATE_PLACEHOLDERS: &'static str = "lmn.template.validate_placeholders";
20
21    /// Span covering circular reference detection during template parsing.
22    pub const TEMPLATE_CHECK_CIRCULAR_REFS: &'static str = "lmn.template.check_circular_refs";
23
24    /// Span covering the full parse + validation of a response template file.
25    pub const RESPONSE_TEMPLATE_PARSE: &'static str = "lmn.response_template.parse";
26
27    /// Span covering the entire request execution phase across all workers.
28    pub const REQUESTS: &'static str = "lmn.requests";
29
30    /// Span covering a single outbound HTTP request.
31    pub const REQUEST: &'static str = "lmn.request";
32
33    /// Returns the shared top-level prefix used for all span names.
34    pub fn prefix() -> &'static str {
35        Self::PREFIX
36    }
37}