Crate hyperactor_telemetry

Crate hyperactor_telemetry 

Source

Re-exports§

pub use trace_dispatcher::DispatcherControl;
pub use trace_dispatcher::FieldValue;
pub use trace_dispatcher::TraceEvent;
pub use trace_dispatcher::TraceEventSink;
pub use opentelemetry;
pub use tracing;

Modules§

env
in_memory_reader
recorder
sinks
Exporters for the unified telemetry layer. Each exporter implements the TraceExporter trait and handles writing events to a specific backend (SQLite, Scuba, glog, etc).
sqlite
task
trace
trace_dispatcher
Unified telemetry layer that captures trace events once and fans out to multiple exporters on a background thread, eliminating redundant capture and moving work off the application thread.

Macros§

context_span
Create a context span at ERROR level with skip_record enabled. This is intended to create spans whose only purpose it is to add context to child events; the span itself is never independently recorded.
debug_every_ms
Rate-limited debug logging. See [info_every_ms!] for details.
debug_every_n
Rate-limited debug logging. See [info_every_n!] for details.
declare_observable_gauge
Create a thread safe static observable gauge that can be set to a specific value based on the provided callback. This is useful for metrics that need to be calculated or retrieved dynamically. The callback will be executed whenever the gauge is observed by the metrics system.
declare_static_counter
Create a thread safe static counter that can be incremeneted or decremented. This is useful to avoid creating temporary counters. You can safely create counters with the same name. They will be joined by the underlying runtime and are thread safe.
declare_static_gauge
Create a thread safe static gauge that can be set to a specific value. This is useful to avoid creating temporary gauges. You can safely create gauges with the same name. They will be joined by the underlying runtime and are thread safe.
declare_static_histogram
Create a thread safe static histogram that can be incremeneted or decremented. This is useful to avoid creating temporary histograms. You can safely create histograms with the same name. They will be joined by the underlying runtime and are thread safe.
declare_static_timer
Create a thread safe static timer that can be used to measure durations. This macro creates a histogram with predefined boundaries appropriate for the specified time unit. Supported units are “ms” (milliseconds), “us” (microseconds), and “ns” (nanoseconds).
declare_static_up_down_counter
Create a thread safe static counter that can be incremeneted or decremented. This is useful to avoid creating temporary counters. You can safely create counters with the same name. They will be joined by the underlying runtime and are thread safe.
error_every_ms
Rate-limited error logging. See [info_every_ms!] for details.
error_every_n
Rate-limited error logging. See [info_every_n!] for details.
info_every_ms
Rate-limited logging that emits at most once per N milliseconds per call site.
info_every_n
Count-based rate-limited logging that emits on the first invocation, then once every N invocations per call site (matching glog behavior).
key_value
Create key value pairs for use in opentelemetry. These pairs can be stored and used multiple times. Opentelemetry adds key value attributes when you bump counters and histograms. so MY_COUNTER.add(42, &[key_value!(“key”, “value”)]) and MY_COUNTER.add(42, &[key_value!(“key”, “other_value”)]) will actually bump two separete counters.
kv_pairs
Construct the key value attribute slice using mapping syntax. Example:
spawn
trace_every_ms
Rate-limited trace logging. See [info_every_ms!] for details.
trace_every_n
Rate-limited trace logging. See [info_every_n!] for details.
warn_every_ms
Rate-limited warn logging. See [info_every_ms!] for details.
warn_every_n
Rate-limited warn logging. See [info_every_n!] for details.

Structs§

ActorEvent
Event data for actor creation. This is passed to EntityEventDispatcher implementations when an actor is spawned.
ActorStatusEvent
Event data for actor status changes. This is passed to EntityEventDispatcher implementations when an actor changes status.
DefaultTelemetryClock
Key
The key part of attribute KeyValue pairs.
KeyValue
A key-value pair describing an attribute.
Level
Describes the level of verbosity of a span or event.
MeshEvent
Event data for mesh creation. This is passed to EntityEventDispatcher implementations when a mesh is spawned.
MessageEvent
Event fired when a message is received (from receiver’s perspective).
MessageStatusEvent
Event fired when a received message changes status.
SentMessageEvent
Event fired when a message is sent to an actor mesh.
TelemetrySample
Timer
TimerGuard

Enums§

EntityEvent
Unified event enum for all entity lifecycle events.
TimeUnit
Value
The value part of attribute KeyValue pairs.

Constants§

MAST_HPC_JOB_NAME_ENV
skip_record
A marker field used to indicate that a span should not be recorded as individual start/end span events; rather the span is purely used to provide context for child events.

Traits§

EntityEventDispatcher
Trait for dispatchers that receive unified entity events.
TelemetryClock
TelemetryTestHandle

Functions§

generate_actor_status_event_id
Generate a globally unique ActorStatusEvent ID.
generate_message_id
Generate a unique received-message ID (cross-process unique).
generate_sent_message_id
Generate a globally unique SentMessage ID.
generate_status_event_id
Generate a unique message-status-event ID (cross-process unique).
hash_to_u64
Hash any hashable value to a u64 using DefaultHasher.
initialize_logging
Set up logging based on the given execution environment. We specialize logging based on how the logs are consumed. The destination scuba table is specialized based on the execution environment. mast -> monarch_tracing/prod devserver -> monarch_tracing/local unit test -> monarch_tracing/test scuba logging won’t normally be enabled for a unit test unless we are specifically testing logging, so you don’t need to worry about your tests being flakey due to scuba logging. You have to manually call initialize_logging() to get this behavior.
initialize_logging_for_test
testing
initialize_logging_with_log_prefix
Set up logging based on the given execution environment. We specialize logging based on how the logs are consumed. The destination scuba table is specialized based on the execution environment. mast -> monarch_tracing/prod devserver -> monarch_tracing/local unit test -> monarch_tracing/test scuba logging won’t normally be enabled for a unit test unless we are specifically testing logging, so you don’t need to worry about your tests being flakey due to scuba logging. You have to manually call initialize_logging() to get this behavior.
initialize_logging_with_log_prefix_mock_scuba
log_file_path
meter
Creates a named [Meter] via the currently configured global [MeterProvider].
notify_actor_created
Notify the registered dispatcher that an actor was created. If no dispatcher is registered yet, the event is buffered and will be replayed when set_entity_dispatcher is called.
notify_actor_status_changed
Notify the registered dispatcher that an actor changed status. If no dispatcher is registered yet, the event is buffered and will be replayed when set_entity_dispatcher is called.
notify_mesh_created
Notify the registered dispatcher that a mesh was created. If no dispatcher is registered yet, the event is buffered and will be replayed when set_entity_dispatcher is called.
notify_message
Notify the registered dispatcher that a message was received.
notify_message_status
Notify the registered dispatcher that a message changed status.
notify_sent_message
Notify the registered dispatcher that a message was sent. If no dispatcher is registered yet, the event is buffered and will be replayed when set_entity_dispatcher is called.
recorder
The recorder singleton that is configured as a layer in the the default tracing subscriber, as configured by initialize_logging.
register_sink
Register a sink to receive trace events. This can be called at any time - before or after telemetry initialization. The sink will receive all trace events on the background worker thread.
set_entity_dispatcher
Set the dispatcher to receive all entity events.
swap_telemetry_clock
Hotswap the telemetry clock at runtime. This allows changing the clock implementation after initialization, which is useful for testing or switching between real and simulated time.
username