Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

docs(openhuman-embed): document the OTLP span export path

Steven Enamakelc44520e509de
diff --git a/crates/openhuman-embed/OBSERVERS.md b/crates/openhuman-embed/OBSERVERS.md
index 2892dd25a6..48c0a0a534 100644
--- a/crates/openhuman-embed/OBSERVERS.md
+++ b/crates/openhuman-embed/OBSERVERS.md
@@ -53,8 +53,13 @@ API and await its cleanup when completion telemetry is required.
The optional `langfuse` feature forwards the existing transport through
`observe::langfuse`: `LangfuseClient`, `LangfuseAuth`, score types and trace
-configuration. Hosts build their own batches from curated `TurnObservation`
-events and queue `send_batch` outside synchronous callbacks. The adapter adds
+configuration, plus the OTLP span builder (`TraceSpan`, `SpanKind`,
+`SpanStatus`, `ExportBrand`, `otlp_requests`). Hosts build their own spans
+from curated `TurnObservation` events, turn them into OTLP requests with
+`otlp_requests`, and queue `LangfuseClient::send_otlp` outside synchronous
+callbacks. OTLP is Langfuse's supported trace path; the legacy batch
+ingestion API is sunset on Langfuse Cloud on 2026-11-16, though scores still
+go through `create_score`. The adapter adds
no second HTTP transport. Harness events, journal records, runtime identifiers
and native inference usage types are not part of this public facade.
diff --git a/crates/openhuman-embed/tests/turn_observers.rs b/crates/openhuman-embed/tests/turn_observers.rs
index 2ff9513b0d..c4b8cf8bac 100644
--- a/crates/openhuman-embed/tests/turn_observers.rs
+++ b/crates/openhuman-embed/tests/turn_observers.rs
@@ -69,3 +69,36 @@ fn existing_langfuse_exporter_builds_a_host_owned_batch_without_network() {
assert_eq!(batch["batch"][0]["body"]["traceId"], "run");
assert!(!batch.to_string().contains("fixture-token"));
}
+
+#[cfg(feature = "langfuse")]
+#[test]
+fn existing_otlp_builder_turns_host_spans_into_requests_without_network() {
+ use openhuman_embed::observe::langfuse::{
+ otlp_requests, ExportBrand, LangfuseClient, SpanKind, SpanStatus, TraceSpan,
+ };
+ let root = TraceSpan {
+ trace_id: "trace".into(),
+ span_id: "root".into(),
+ parent_span_id: None,
+ name: "host.run".into(),
+ kind: SpanKind::Turn,
+ start_unix_ms: 1,
+ end_unix_ms: Some(2),
+ status: SpanStatus::Ok,
+ attributes: Default::default(),
+ input: None,
+ output: None,
+ };
+ let brand = ExportBrand {
+ product: "host",
+ version: "1.0.0",
+ };
+ let requests = otlp_requests(&[root], "development", &brand);
+ assert_eq!(requests.len(), 1);
+ assert!(requests[0]["resourceSpans"][0]["scopeSpans"][0]["spans"].is_array());
+ let client = LangfuseClient::direct("https://lf.example.test", "pk", "sk").unwrap();
+ assert_eq!(
+ client.otlp_endpoint(),
+ "https://lf.example.test/api/public/otel/v1/traces"
+ );
+}
diff --git a/scripts/lib/agent-sdk-contracts.mjs b/scripts/lib/agent-sdk-contracts.mjs
index 0a3a346277..40d4e58922 100644
--- a/scripts/lib/agent-sdk-contracts.mjs
+++ b/scripts/lib/agent-sdk-contracts.mjs
@@ -5,7 +5,7 @@ const contracts = new Map([
"pub use tinyinference_llm::model::budget::{Budget, BudgetExceeded, BudgetSnapshot, CallBudget, Spend, SpendLimits};",
)],
["crates/openhuman-core/src/agent/tinyagents/turn_observer.rs", compact(
- "pub use tinyagents_harness::observability::{LangfuseAuth, LangfuseClient, LangfuseScore, LangfuseScoreValue, LangfuseTraceConfig};",
+ "pub use tinyagents_harness::observability::{trace_export::{otlp::otlp_requests, ExportBrand, SpanKind, SpanStatus, TraceSpan}, LangfuseAuth, LangfuseClient, LangfuseScore, LangfuseScoreValue, LangfuseTraceConfig};",
)],
]);