Skip to content

Commit 7717d47

Browse files
committed
make extracted spans a list and allow overwriting headers in the map
1 parent 25fac4c commit 7717d47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/system-tests/request_handler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ void RequestHandler::on_extract_headers(const httplib::Request& req,
256256
// clang-format on
257257

258258
res.set_content(response_body.dump(), "application/json");
259-
http_headers_.emplace(span->parent_id().value(), std::move(*http_headers));
259+
http_headers_[span->parent_id().value()] = std::move(*http_headers);
260260
// The span below will not be finished and flushed.
261-
extract_headers_spans_.emplace(span->parent_id().value(), std::move(*span));
261+
extract_headers_spans_.push_back(std::move(*span));
262262
}
263263

264264
void RequestHandler::on_span_flush(const httplib::Request& /* req */,

test/system-tests/request_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RequestHandler final {
3838
std::shared_ptr<ManualScheduler> scheduler_;
3939
std::shared_ptr<DeveloperNoiseLogger> logger_;
4040
std::unordered_map<uint64_t, datadog::tracing::Span> active_spans_;
41-
std::unordered_map<uint64_t, datadog::tracing::Span> extract_headers_spans_;
41+
std::vector<datadog::tracing::Span> extract_headers_spans_;
4242
std::unordered_map<uint64_t, nlohmann::json::array_t> http_headers_;
4343

4444
#undef VALIDATION_ERROR

0 commit comments

Comments
 (0)