Eyes Subscriber
A tracing subscriber for sending structured trace data to Eyes (eyes.coreyja.com).
Quick Start
use eyes_subscriber::EyesSubscriberBuilder;
use tracing_subscriber::prelude::*;
use uuid::Uuid;
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let org_id = Uuid::parse_str("your-org-id")?;
let app_id = Uuid::parse_str("your-app-id")?;
// Simplest: auto-configure from environment variables
let (eyes_layer, shutdown_handle) = EyesSubscriberBuilder::build_from_env(org_id, app_id)?;
tracing_subscriber::registry()
.with(eyes_layer)
.init();
// Your application code here
tracing::info!("Application started");
// Graceful shutdown
shutdown_handle.shutdown().await?;
# Ok(())
# }
Configuration
The subscriber can be configured in several ways:
- Environment variables (recommended):
EYES_URL: Override the default URL (defaults to https://eyes.coreyja.com)EYES_TRANSPORT: Set to "websocket" or "ws" for WebSocket, defaults to HTTP
- Default production: Use
new_with_default()for https://eyes.coreyja.com - Custom URL: Use
new()with any URL for self-hosted instances
Transports
Two transport methods are available:
- HTTP (default): Reliable, request/response based
- WebSocket: Lower latency, persistent connection