Skip to content

Commit 8deaf53

Browse files
committed
add parent span support
1 parent d7efc7a commit 8deaf53

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

core/impl/lookup_in_replica.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ lookup_in_replica_request::encode_to(lookup_in_replica_request::encoded_request_
3939
encoded.opaque(opaque);
4040
encoded.partition(partition);
4141
encoded.body().id(id);
42-
encoded.body().read_replica(read_replica);
42+
encoded.body().read_replica(true);
4343
encoded.body().specs(specs);
4444
return {};
4545
}

core/impl/lookup_in_replica.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct lookup_in_replica_request {
5757
document_id id;
5858
std::vector<couchbase::core::impl::subdoc::command> specs{};
5959
std::optional<std::chrono::milliseconds> timeout{};
60-
bool read_replica{ true };
60+
std::shared_ptr<couchbase::tracing::request_span> parent_span{ nullptr };
6161
std::uint16_t partition{};
6262
std::uint32_t opaque{};
6363
io::retry_context<false> retries{};

core/operations/document_lookup_in_all_replicas.hxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ struct lookup_in_all_replicas_request {
6464
core::document_id id;
6565
std::vector<couchbase::core::impl::subdoc::command> specs{};
6666
std::optional<std::chrono::milliseconds> timeout{};
67+
std::shared_ptr<couchbase::tracing::request_span> parent_span{ nullptr };
6768

6869
template<typename Core, typename Handler>
6970
void execute(Core core, Handler handler)
7071
{
7172
core->with_bucket_configuration(
7273
id.bucket(),
73-
[core, id = id, timeout = timeout, specs = specs, h = std::forward<Handler>(handler)](
74+
[core, id = id, timeout = timeout, specs = specs, parent_span = parent_span, h = std::forward<Handler>(handler)](
7475
std::error_code ec, const topology::configuration& config) mutable {
7576
if (ec) {
7677
std::optional<std::string> first_error_path{};
@@ -98,7 +99,7 @@ struct lookup_in_all_replicas_request {
9899
for (std::size_t idx = 1U; idx <= config.num_replicas.value_or(0U); ++idx) {
99100
document_id replica_id{ id };
100101
replica_id.node_index(idx);
101-
core->execute(impl::lookup_in_replica_request{ std::move(replica_id), specs, timeout },
102+
core->execute(impl::lookup_in_replica_request{ std::move(replica_id), specs, timeout, parent_span },
102103
[ctx](impl::lookup_in_replica_response&& resp) {
103104
handler_type local_handler{};
104105
{

core/operations/document_lookup_in_any_replica.hxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ struct lookup_in_any_replica_request {
4848
core::document_id id;
4949
std::vector<couchbase::core::impl::subdoc::command> specs{};
5050
std::optional<std::chrono::milliseconds> timeout{};
51+
std::shared_ptr<couchbase::tracing::request_span> parent_span{ nullptr };
5152

5253
template<typename Core, typename Handler>
5354
void execute(Core core, Handler handler)
5455
{
5556
core->with_bucket_configuration(
5657
id.bucket(),
57-
[core, id = id, timeout = timeout, specs = specs, h = std::forward<Handler>(handler)](
58+
[core, id = id, timeout = timeout, specs = specs, parent_span = parent_span, h = std::forward<Handler>(handler)](
5859
std::error_code ec, const topology::configuration& config) mutable {
5960
if (ec) {
6061
std::optional<std::string> first_error_path{};
@@ -81,7 +82,7 @@ struct lookup_in_any_replica_request {
8182
for (std::size_t idx = 1U; idx <= config.num_replicas.value_or(0U); ++idx) {
8283
document_id replica_id{ id };
8384
replica_id.node_index(idx);
84-
core->execute(impl::lookup_in_replica_request{ std::move(replica_id), specs, timeout },
85+
core->execute(impl::lookup_in_replica_request{ std::move(replica_id), specs, timeout, parent_span },
8586
[ctx](impl::lookup_in_replica_response&& resp) {
8687
handler_type local_handler;
8788
{

0 commit comments

Comments
 (0)