Module protocol
Expand description
Telemetry protocol types and message definitions.
This module defines the core data structures used for telemetry message exchange. It includes message types for logging, tracing, and time synchronization, as well as supporting types for execution tracking and attribute management.
§Message Types
The protocol supports several categories of telemetry messages:
- Log Messages - Structured logging with severity levels and attributes
- Tracing Messages - Distributed tracing with spans, events, and links
- Time Sync Messages - Time synchronization between systems
§Thread Tracking
Each message is associated with an ThreadId that uniquely identifies
the thread it came from (globally unique across all processes).
This allows telemetry data from multiple threads to be correlated and analyzed separately.
§Serialization
All protocol types implement serde::Serialize and optionally serde::Deserialize
(when the alloc feature is enabled) for easy serialization to various formats.
Structs§
- Instance
Message - A telemetry message associated with a specific execution thread.
- LogMessage
- A structured log message with severity, timestamp, and attributes.
- Process
Id - A globally-unique id identifying a process.
- Span
AddEvent Message - Message indicating an event has been added to a span.
- Span
AddLink Message - Message indicating a link has been added to a span.
- Span
Close Message - Message indicating a span has been closed (completed).
- Span
Create Message - Message indicating the creation of a new span.
- Span
Enter Message - Message indicating a span has been entered.
- Span
Exit Message - Message indicating a span has been exited.
- SpanId
- A process-unique id for a span.
- Span
SetAttribute Message - Message indicating an attribute has been set on a span.
- Thread
Id - A globally-unique id identifying a thread within a specific process.
- Time
Sync Message - A time synchronization message for coordinating clocks between systems.
Enums§
- Parse
Thread IdError - Errors that can occur while parsing
ThreadIdfrom a string. - Severity
- Log message severity levels.
- Telemetry
Message - An enumeration of all possible telemetry message types.
- Tracing
Message - Messages related to distributed tracing operations.
Functions§
- attribute_
list_ from_ slice - A specialised form of
list_from_slicefor attributes.
Type Aliases§
- Attribute
List Type - Type alias for a list of attributes.