Public declaration syntax from forge-rs/crates/forge-core/src/telemetry.rs Original source SHA-256: fed2e60efe62c7192511ef618f76c0e5cb1f7f9d3b2249e09c966f68656afd3f Function bodies and constant values are omitted. This is not the complete implementation. Source line 21 pub const SPAN_GENERATE: &str; Source line 24 pub const SPAN_TOOL_INVOKE: &str; Source line 27 pub const SPAN_TASK_DELEGATE: &str; Source line 30 pub const SPAN_TASK_EXECUTE: &str; Source line 33 pub const SPAN_SESSION: &str; Source line 36 pub const SPAN_LIFECYCLE: &str; Source line 39 pub const SPAN_MESSAGE_SEND: &str; Source line 68 #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum AuditEventKind { /// An agent was instantiated with identity and capabilities. AgentInstantiated, /// A capability check was performed against an Arsenal ACT. CapabilityCheck, /// A tool was invoked by the agent. ToolInvocation, /// A network access operation occurred (HTTP, WebSocket, etc.). NetworkAccess, /// An inter-agent message was sent or received. InterAgentMessage, /// A lifecycle state transition occurred. LifecycleTransition, /// A resource quota event was triggered (usage approaching or exceeding limits). ResourceQuota, /// An agent joined a session. SessionJoin, /// An agent left a session. SessionLeave, /// A task was delegated to a sub-agent. TaskDelegation, /// An interrupt signal was received and processed. Interrupt, /// A write to the agent's context or memory occurred. ContextWrite, } Source line 108 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ForgeSpan { /// The span name (e.g., "forge.agent.generate", "forge.tool.execute"). pub name: String, /// Span start time. pub start_time: Timestamp, /// Span end time (set when span completes). pub end_time: Option, /// Key-value attributes. pub attributes: HashMap, /// Span status. pub status: SpanStatus, /// Parent span ID for distributed tracing. pub parent_id: Option, /// This span's unique ID. pub span_id: String } Source line 131 pub fn new(name: impl Into) -> Self; Source line 149 pub fn set_attribute(&mut self, key: impl Into, value: impl Into); Source line 154 pub fn end(&mut self); Source line 159 pub fn end_with_error(&mut self, message: impl Into); Source line 167 pub fn with_parent(mut self, parent_id: impl Into) -> Self; Source line 178 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ForgeEvent { /// The event name. pub name: String, /// When the event occurred. pub timestamp: Timestamp, /// Key-value attributes. pub attributes: HashMap } Source line 189 pub fn new(name: impl Into) -> Self; Source line 198 pub fn set_attribute(&mut self, key: impl Into, value: impl Into); Source line 206 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(tag = "code", rename_all = "snake_case")] pub enum SpanStatus { /// Status not set (default). Unset, /// Operation completed successfully. Ok, /// Operation failed with an error. Error { /// Error message. message: String, }, } Source line 221 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(untagged)] pub enum SpanAttribute { /// A string value. String(String), /// An integer value. Int(i64), /// A floating-point value. Float(f64), /// A boolean value. Bool(bool), } Source line 279 pub trait TelemetryEmitter: Send + Sync { /// Emits a completed span. fn emit_span(&self, span: &ForgeSpan); /// Emits an event. fn emit_event(&self, event: &ForgeEvent); } Source line 287 pub struct NoopEmitter;