iron_telemetry
Structured logging and tracing for all Iron Cage crates.
Installation
[]
= { = "../iron_telemetry" }
Quick Start
use ;
// Initialize logging with default configuration
init_logging?;
// Log agent lifecycle events
log_agent_event;
// Log PII detection (specialized format)
log_pii_detection;
// Output: [14:32:05] INFO agent-001 | Agent started processing leads
// Output: [14:32:06] WARN agent-001 | PII DETECTED: email redacted
Responsibilities:
Provides centralized logging abstraction using the tracing crate. Outputs structured, timestamped, colored logs for terminal display and machine-readable JSON for storage. Injects agent context into all log events for traceability.
In Scope:
- Structured logging via
tracingcrate - Terminal output formatting (timestamp, colors, human-readable)
- Log levels (DEBUG, INFO, WARN, ERROR, CRIT, OK)
- Agent context injection (agent_id in all events)
- Specialized logging functions (PII detections, budget warnings, circuit breaker events)
- Environment-based log level configuration
- JSON export for audit compliance
Out of Scope:
- Log aggregation to external services (Datadog, Splunk, Grafana)
- Log sampling and filtering (future)
- Distributed tracing (OpenTelemetry integration)
- Log rotation and archival (future)
- Metrics collection (Prometheus, StatsD)
- Custom log formatters (future)
- Dashboard log display (see iron_dashboard)
Source Files
| File | Responsibility |
|---|---|
| lib.rs | Centralized structured logging and tracing for Iron Runtime. |
Notes:
- Entries marked 'TBD' require manual documentation
- Entries marked '⚠️ ANTI-PATTERN' should be renamed to specific responsibilities
License
Apache-2.0