Attribute Macro observe_result

Source
#[observe_result]
Expand description

A procedural macro that automatically injects telemetry code into async functions that return a Result type.

This macro wraps async functions and adds instrumentation to measure:

  1. Latency - how long the function takes to execute
  2. Error counter - function error count
  3. Success counter - function completion count

ยงExample

use hyperactor_actor::observe_result;

#[observe_result("my_module")]
async fn process_request(user_id: &str) -> Result<String, Error> {
    // Function implementation
    // Telemetry will be automatically collected
}