dial9_core/schema_extensions.rs
1//! Dial9 conventions layered on top of free-form trace schema annotations.
2//!
3//! The wire format treats annotation keys and values as opaque strings. This
4//! module is the shared vocabulary used by Dial9 producers and consumers.
5
6/// Annotation key assigning a structural role to a field.
7pub const ROLE_KEY: &str = "dial9.role";
8
9/// Annotation key carrying the producer or instrumentation family for a span.
10pub const SPAN_TYPE_KEY: &str = "dial9.span.type";
11
12/// Span type used when a single-event span schema does not declare a producer
13/// or instrumentation family.
14pub const DEFAULT_SPAN_TYPE: &str = "single-event";
15
16/// Values emitted under [`SPAN_TYPE_KEY`].
17pub mod span_types {
18 /// The metrique adapter's single-event spans.
19 pub const METRIQUE: &str = "metrique";
20}
21
22/// Values recognized under [`ROLE_KEY`].
23pub mod roles {
24 /// Start timestamp of a completed single-event span.
25 pub const SPAN_START: &str = "span.start";
26
27 /// Duration of a completed single-event span. A decoder needs any two of
28 /// start, duration, and end (the packed event timestamp) to place the
29 /// span; the third is derived.
30 pub const SPAN_DURATION: &str = "span.duration";
31
32 /// Dynamic display name of a completed single-event span.
33 pub const SPAN_NAME: &str = "span.name";
34
35 /// OS thread ID captured at span start.
36 pub const THREAD_ID: &str = "thread_id";
37
38 /// Tokio task ID captured at span start.
39 pub const TOKIO_TASK_ID: &str = "tokio.task_id";
40
41 /// Tokio worker ID captured at span start.
42 pub const TOKIO_WORKER_ID: &str = "tokio.worker_id";
43}