|
NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
|
Opaque per-request span; lifetime is unique_ptr. More...
#include <tracer.h>
Public Member Functions | |
| virtual void | add_event (std::string_view name, std::string_view payload={})=0 |
Record a discrete time-stamped event on this span (mapped to OTel's Span::AddEvent). | |
| virtual void | end ()=0 |
| Close the span. | |
| void | set_attribute (std::string_view key, const char *value) |
Forwarding overload so string literals ("CHAIN") reach the string_view sink rather than slipping into a different overload. | |
| virtual void | set_attribute_bool (std::string_view key, bool value)=0 |
Renamed off the set_attribute overload set on purpose: a const char* literal passed as the value would otherwise resolve to (string_view, bool) (pointer-to-bool standard conversion outranks the user-defined string_view conversion), silently dropping every string attribute. | |
Opaque per-request span; lifetime is unique_ptr.
Adapters create a Span by wrapping their backend's span handle (e.g. opentelemetry::trace::Span). Calling end() is required before destruction for proper export — the destructor does NOT call end() on its own (an unended span signals "still in flight" to the OpenInference helpers and lets _close_all-style cleanup paths distinguish active vs. already-ended spans).
Thread safety: implementations MAY be called from multiple threads (engine event callback runs on whatever pool worker emitted the event). Adapter authors must serialize internally if their backend span isn't thread-safe.
|
pure virtual |
Record a discrete time-stamped event on this span (mapped to OTel's Span::AddEvent).
Used by the openinference layer for LLM_TOKEN events so each streamed chunk is visible in the trace timeline without inflating the parent span's attribute payload.
|
pure virtual |
Close the span.
After end() returns the span is finalized; further attribute / event writes are no-ops on most backends.
|
inline |
|
pure virtual |
Renamed off the set_attribute overload set on purpose: a const char* literal passed as the value would otherwise resolve to (string_view, bool) (pointer-to-bool standard conversion outranks the user-defined string_view conversion), silently dropping every string attribute.
Keep bool out of the overload set entirely.