Expand description
§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;
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?;§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 HTTPEYES_QUEUE_CAPACITY: Capacity of the bounded event queue (defaults to 65536)EYES_EMIT_ENTER_EXIT: Set to “1” or “true” (case-insensitive) to emitspan_enter/span_exitevents (disabled by default; seeEyesSubscriberBuilder::with_emit_enter_exit)
- Default production: Use
new_with_default()for https://eyes.coreyja.com - Custom URL: Use
new()with any URL for self-hosted instances
§Transports
Three transport methods are available:
- HTTP (default): Reliable, request/response based
- BatchingHttp: HTTP with client-side batching for high-volume use cases
- WebSocket: Lower latency, persistent connection
Structs§
- AppManifest
- The shape of the application, as reported once at boot.
- Batch
Config - Configuration for batching behavior
- Batching
Http Transport - HTTP transport with batching support
- Cron
Entry - A single cron registration: its name and schedule string.
- Eyes
Layer - Eyes
Shutdown Handle - Eyes
Subscriber Builder - Http
Monitor - Http
Transport - WebSocket
Transport
Enums§
- Http
Method - Manifest
Error - Error sending a boot manifest.
- Monitor
Target Error - Transport
Error - Transport
Type
Constants§
- DEFAULT_
QUEUE_ CAPACITY - Default capacity of the bounded event queue between the tracing layer and
the transport loop. Overridable via
EYES_QUEUE_CAPACITYorEyesSubscriberBuilder::with_queue_capacity. - MANIFEST_
VERSION - The manifest schema version this crate emits.
Functions§
- is_
forbidden_ monitor_ ip - Returns true when an address is not an acceptable monitor egress target. This is shared by declaration validation and the connection-time resolver.
- monitor_
origin - Return the normalized HTTP origin used for monitor security comparisons.
- resolve_
monitor_ target - Resolve and validate an absolute HTTP(S) URL or a root-relative path.
- send_
manifest - Send a boot-time manifest to the Eyes server as a one-shot HTTP POST.
- send_
manifest_ from_ env send_manifest, reading the destination from the environment: