What
Introduce convenience methods on a Trace object so callers can write trace.generation(...), trace.span(...), and trace.event(...) instead of always going through client.observations.create(type: 'GENERATION', trace_id: ...).
Why
The current API requires callers to pass both type and trace_id on every observation, which is verbose and error-prone. Official SDKs (Python, JavaScript) expose typed builder methods on the trace object. Providing the same ergonomics makes the gem feel idiomatic and reduces boilerplate in instrumented code. The competing langfuse-ruby (ai-firstly) gem already ships this pattern.
Effort estimate
M (2–3 days) — introduce a Trace wrapper class that holds trace_id and delegates typed creation calls to the observations client; update docs and add specs.
What
Introduce convenience methods on a
Traceobject so callers can writetrace.generation(...),trace.span(...), andtrace.event(...)instead of always going throughclient.observations.create(type: 'GENERATION', trace_id: ...).Why
The current API requires callers to pass both
typeandtrace_idon every observation, which is verbose and error-prone. Official SDKs (Python, JavaScript) expose typed builder methods on the trace object. Providing the same ergonomics makes the gem feel idiomatic and reduces boilerplate in instrumented code. The competing langfuse-ruby (ai-firstly) gem already ships this pattern.Effort estimate
M (2–3 days) — introduce a
Tracewrapper class that holdstrace_idand delegates typed creation calls to the observations client; update docs and add specs.