MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / make_span_create

Function make_span_create

src/langfuse/tracer.cpp:330–347  ·  view source on GitHub ↗

Build a span-create event body. Used for both tool-call starts (open span) and the synthetic span emitted in record_tool_call_finish's fallback path.

Source from the content-addressed store, hash-verified

328// Build a span-create event body. Used for both tool-call starts (open span)
329// and the synthetic span emitted in record_tool_call_finish's fallback path.
330JsonValue make_span_create(const std::string& span_id,
331 const std::string& trace_id,
332 const std::string& parent_id,
333 const std::string& name,
334 const std::string& start_iso,
335 const JsonValue& input,
336 const std::string& environment) {
337 JsonValue body;
338 body["id"] = span_id;
339 body["traceId"] = trace_id;
340 body["name"] = name;
341 body["startTime"] = start_iso;
342 body["input"] = input;
343 body["environment"] = environment;
344 if (!parent_id.empty())
345 body["parentObservationId"] = parent_id;
346 return body;
347}
348
349JsonValue wrap_event(const char* type,
350 const std::string& timestamp,

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected