1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//! Langfuse-compatible observability engine for Juncture AI agents.
//!
//! This crate provides a zero-dependency telemetry system that captures
//! traces, observations (LLM calls, tool calls, spans), sessions, and
//! metrics directly within the Juncture process. No external services
//! (otel-collector, Jaeger, Prometheus) are required.
//!
//! # Architecture
//!
//! ```text
//! TelemetryCollector
//! └── BatchWriter (async, non-blocking)
//! └── TraceStore (SQLite / PostgreSQL)
//! └── Web Viewer (Langfuse-compatible API)
//! ```
//!
//! # Quick Start
//!
//! ```ignore
//! use juncture_telemetry::{TelemetryCollector, SqliteStore};
//! use std::sync::Arc;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let store = Arc::new(SqliteStore::new("telemetry.db").await?);
//! let collector = TelemetryCollector::new(store);
//!
//! // ... run your graph with collector ...
//!
//! collector.flush().await?;
//! Ok(())
//! }
//! ```
// Re-exports for convenience
pub use ;
pub use TelemetryCollector;
pub use ;
pub use ;
/// Create a new telemetry configuration builder.
///
/// This is the recommended entry point for setting up telemetry.
/// It follows the same pattern as `juncture_tracing::init()`.
///
/// # Examples
///
/// ```ignore
/// use juncture_telemetry::init;
///
/// // Minimal -- in-memory store, no export
/// let telemetry = init().await?;
///
/// // Full setup
/// let telemetry = init()
/// .with_store("telemetry.db")
/// .with_langfuse_from_env()
/// .with_dashboard(8123)
/// .await?;
/// ```
pub use ;
pub use SqliteStore;
pub use ;
// Rust guideline compliant 2026-06-01