| 180 | } |
| 181 | |
| 182 | std::shared_ptr<Trace> Tracer::start_trace(const std::string& name, |
| 183 | TraceOptions opts) { |
| 184 | auto trace = std::make_shared<Trace>(*this, Trace::new_uuid(), name); |
| 185 | if (opts.input) |
| 186 | trace->set_input(std::move(*opts.input)); |
| 187 | if (opts.output) |
| 188 | trace->set_output(std::move(*opts.output)); |
| 189 | if (opts.user_id) |
| 190 | trace->set_user_id(std::move(*opts.user_id)); |
| 191 | if (opts.session_id) |
| 192 | trace->set_session_id(std::move(*opts.session_id)); |
| 193 | if (opts.metadata) |
| 194 | trace->set_metadata(std::move(*opts.metadata)); |
| 195 | for (auto& t : opts.tags) |
| 196 | trace->add_tag(std::move(t)); |
| 197 | return trace; |
| 198 | } |
| 199 | |
| 200 | bool Tracer::send_batch(const JsonValue& events) { |
| 201 | if (!is_valid()) { |
no test coverage detected