1use hyperactor_telemetry::declare_static_counter;
14use hyperactor_telemetry::declare_static_histogram;
15use hyperactor_telemetry::declare_static_timer;
16use hyperactor_telemetry::declare_static_up_down_counter;
17
18#[derive(Debug, Clone, Copy)]
20pub enum ChannelErrorType {
21 SendError,
23 ConnectionError,
25 DeframeError,
27 DeserializeError,
29}
30
31impl ChannelErrorType {
32 pub fn as_str(&self) -> &'static str {
34 match self {
35 ChannelErrorType::SendError => "send_error",
36 ChannelErrorType::ConnectionError => "connection_error",
37 ChannelErrorType::DeframeError => "deframe_error",
38 ChannelErrorType::DeserializeError => "deserialize_error",
39 }
40 }
41}
42
43declare_static_counter!(
46 MAILBOX_UNDELIVERABLE_MESSAGES,
47 "mailbox.undeliverable_messages"
48);
49hyperactor_telemetry::declare_static_counter!(MAILBOX_POSTS, "mailbox.posts");
51
52declare_static_up_down_counter!(ACTOR_MESSAGE_QUEUE_SIZE, "actor.message_queue_size");
55declare_static_counter!(ACTOR_MESSAGES_SENT, "actor.messages_sent");
57declare_static_counter!(ACTOR_MESSAGES_RECEIVED, "actor.messages_received");
59declare_static_counter!(ACTOR_MESSAGE_RECEIVE_ERRORS, "actor.message_receive_errors");
61declare_static_timer!(
63 ACTOR_MESSAGE_HANDLER_DURATION,
64 "actor.message_handler_duration",
65 hyperactor_telemetry::TimeUnit::Nanos
66);
67
68declare_static_histogram!(REMOTE_MESSAGE_SEND_SIZE, "channel.remote_message_send_size");
70declare_static_counter!(CHANNEL_CONNECTIONS, "channel.connections");
72declare_static_counter!(CHANNEL_RECONNECTIONS, "channel.reconnections");
74declare_static_counter!(CHANNEL_ERRORS, "channel.errors");
76declare_static_counter!(CHANNEL_NET_RX_BUFFER_FULL, "channel.net_rx_buffer_full");
81
82declare_static_counter!(CHANNEL_THROUGHPUT_BYTES, "channel.throughput.bytes");
84declare_static_counter!(CHANNEL_THROUGHPUT_MESSAGES, "channel.throughput.messages");
86declare_static_histogram!(CHANNEL_LATENCY_MICROS, "channel.latency.us");
88
89declare_static_counter!(PROC_MESH_ALLOCATION, "proc_mesh.active_procs");
92declare_static_counter!(PROC_MESH_PROC_STOPPED, "proc_mesh.proc_failures");
94declare_static_counter!(PROC_MESH_ACTOR_FAILURES, "proc_mesh.actor_failures");
96
97declare_static_histogram!(MESSAGE_LATENCY_MICROS, "message.e2e_latency.us");