|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
Adapter facade for a tracing backend. More...
#include <tracer.h>
Public Member Functions | |
| virtual std::unique_ptr< Span > | start_span (std::string_view name, Span *parent=nullptr)=0 |
Adapter facade for a tracing backend.
The OpenInference helpers call start_span to open named spans (root + per-node + per-LLM-call). The parent argument carries the span hierarchy — a non-null parent means "open this as a child of
the supplied span", null means "open as a root".
Adapter authors are free to ignore parent if their backend captures parents implicitly via an OTel context propagation hook; the OpenInference helpers DO supply the parent explicitly so a dep-free adapter can link spans without relying on contextvars- style implicit context.
unique_ptr<Span> your start_span returns and may release it (e.g. inside OpenInferenceTracerSession::close()). If your adapter stores raw pointers into the wrapper objects to allow post-close inspection (printing, test asserts, attribute audit), those pointers become dangling at close time — see issue #24.The supported pattern is: own the recorded span DATA in your adapter (a RecordedSpan-style struct held in unique_ptr<RecordedSpan> inside the tracer), and have the Span wrapper your start_span returns merely point at that recorded struct. The wrapper's destruction is then harmless. See tests/test_openinference_cpp.cpp::InMemoryTracer and examples/49_openinference.cpp::PrintTracer for the reference shape.
|
pure virtual |
| name | Span name (e.g. "graph.run", "node.researcher", "llm.complete"). |
| parent | Optional parent span. May be a span this tracer itself returned from a previous start_span. Adapters should treat null as "root span". |
end() before drop.