couchbase 4.4.3 → 4.4.4
Sign up to get free protection for your applications and to get access to all the features.
- package/BUILDING.md +182 -0
- package/CMakeLists.txt +11 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +4 -2
- package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
- package/deps/couchbase-cxx-client/CMakeLists.txt +3 -1
- package/deps/couchbase-cxx-client/README.md +2 -2
- package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
- package/deps/couchbase-cxx-client/cmake/Packaging.cmake +174 -11
- package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +4 -0
- package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +2 -2
- package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
- package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
- package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
- package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
- package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
- package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +27 -3
- package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
- package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +2 -2
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
- package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
- package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
- package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +41 -41
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +15 -16
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
- package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
- package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
- package/dist/analyticsindexmanager.d.ts +98 -14
- package/dist/analyticsindexmanager.js +452 -411
- package/dist/binding.d.ts +53 -4
- package/dist/bindingutilities.d.ts +26 -1
- package/dist/bindingutilities.js +108 -1
- package/dist/couchbase.d.ts +3 -1
- package/dist/couchbase.js +2 -0
- package/dist/rangeScan.d.ts +1 -1
- package/dist/rangeScan.js +1 -1
- package/dist/transactions.d.ts +34 -3
- package/dist/transactions.js +25 -18
- package/dist/transcoders.d.ts +68 -0
- package/dist/transcoders.js +194 -1
- package/dist/usermanager.d.ts +14 -14
- package/dist/usermanager.js +178 -228
- package/dist/utilities.js +4 -6
- package/dist/utilities_internal.js +1 -2
- package/package.json +9 -8
- package/src/connection.cpp +22 -0
- package/src/connection.hpp +12 -0
- package/src/connection_autogen.cpp +100 -0
- package/src/jstocbpp_autogen.hpp +315 -8
- package/src/jstocbpp_transactions.hpp +1 -2
- package/tools/gen-bindings-js.js +38 -3
- package/tools/gen-bindings-json.py +575 -328
@@ -41,6 +41,8 @@ struct get_replica_request {
|
|
41
41
|
using encoded_response_type =
|
42
42
|
core::protocol::client_response<core::protocol::get_replica_response_body>;
|
43
43
|
|
44
|
+
static const inline std::string observability_identifier = "get_replica";
|
45
|
+
|
44
46
|
core::document_id id;
|
45
47
|
std::optional<std::chrono::milliseconds> timeout{};
|
46
48
|
std::uint16_t partition{};
|
@@ -53,6 +53,8 @@ struct lookup_in_replica_request {
|
|
53
53
|
using encoded_response_type =
|
54
54
|
protocol::client_response<protocol::lookup_in_replica_response_body>;
|
55
55
|
|
56
|
+
static const inline std::string observability_identifier = "lookup_in_replica";
|
57
|
+
|
56
58
|
document_id id;
|
57
59
|
std::vector<couchbase::core::impl::subdoc::command> specs{};
|
58
60
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -50,6 +50,8 @@ struct observe_seqno_request {
|
|
50
50
|
using encoded_response_type =
|
51
51
|
core::protocol::client_response<core::protocol::observe_seqno_response_body>;
|
52
52
|
|
53
|
+
static const inline std::string observability_identifier = "observe_seqno";
|
54
|
+
|
53
55
|
core::document_id id;
|
54
56
|
bool active{};
|
55
57
|
std::uint64_t partition_uuid{};
|
@@ -180,6 +180,7 @@ build_query_request(std::string statement,
|
|
180
180
|
std::move(query_context), std::move(options.client_context_id),
|
181
181
|
options.timeout, options.profile,
|
182
182
|
};
|
183
|
+
request.parent_span = options.parent_span;
|
183
184
|
if (!options.raw.empty()) {
|
184
185
|
for (auto& [name, value] : options.raw) {
|
185
186
|
request.raw[name] = std::move(value);
|
@@ -165,6 +165,7 @@ build_search_request(std::string index_name,
|
|
165
165
|
options.client_context_id,
|
166
166
|
options.timeout,
|
167
167
|
};
|
168
|
+
request.parent_span = options.parent_span;
|
168
169
|
return request;
|
169
170
|
}
|
170
171
|
|
@@ -207,6 +208,7 @@ build_search_request(std::string index_name,
|
|
207
208
|
options.client_context_id,
|
208
209
|
options.timeout,
|
209
210
|
};
|
211
|
+
core_request.parent_span = options.parent_span;
|
210
212
|
|
211
213
|
if (auto vector_search = request.vector_search(); vector_search.has_value()) {
|
212
214
|
core_request.vector_search = core::utils::json::generate_binary(vector_search->query);
|
@@ -246,8 +246,8 @@ private:
|
|
246
246
|
}
|
247
247
|
if (self->meter_) {
|
248
248
|
metrics::metric_attributes attrs{
|
249
|
-
|
250
|
-
|
249
|
+
self->request.type,
|
250
|
+
self->request.observability_identifier,
|
251
251
|
ec,
|
252
252
|
};
|
253
253
|
self->meter_->record_value(std::move(attrs), start);
|
@@ -269,7 +269,7 @@ struct mcbp_command : public std::enable_shared_from_this<mcbp_command<Manager,
|
|
269
269
|
std::optional<key_value_error_map_info> /* error_info */) mutable {
|
270
270
|
metrics::metric_attributes attrs{
|
271
271
|
service_type::key_value,
|
272
|
-
|
272
|
+
self->request.observability_identifier,
|
273
273
|
ec,
|
274
274
|
self->request.id.bucket(),
|
275
275
|
self->request.id.scope(),
|
@@ -195,3 +195,14 @@
|
|
195
195
|
* encode document content or decode results.
|
196
196
|
*/
|
197
197
|
#define COUCHBASE_CXX_CLIENT_PUBLIC_API_USES_TAO_JSON_ONLY_FOR_CONTENT
|
198
|
+
|
199
|
+
/**
|
200
|
+
* couchbase::metrics::otel_meter uses the GA version of the OpenTelemetry Metrics API.
|
201
|
+
* The Metrics API for OpenTelemetry was GA'd in version 1.7.0.
|
202
|
+
*/
|
203
|
+
#define COUCHBASE_CXX_CLIENT_OTEL_METER_USES_GA_METRICS_API 1
|
204
|
+
|
205
|
+
/**
|
206
|
+
* All options classes in the Public API expose the parent_span option.
|
207
|
+
*/
|
208
|
+
#define COUCHBASE_CXX_CLIENT_PUBLIC_API_PARENT_SPAN 1
|
@@ -316,6 +316,28 @@ os() -> const std::string&
|
|
316
316
|
return system;
|
317
317
|
}
|
318
318
|
|
319
|
+
namespace
|
320
|
+
{
|
321
|
+
constexpr auto
|
322
|
+
has_wrapper_sdk_id() -> bool
|
323
|
+
{
|
324
|
+
return COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID != nullptr &&
|
325
|
+
COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID[0] != '\0';
|
326
|
+
}
|
327
|
+
|
328
|
+
auto
|
329
|
+
wrapper_sdk_id() -> std::string
|
330
|
+
{
|
331
|
+
return COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID;
|
332
|
+
}
|
333
|
+
|
334
|
+
auto
|
335
|
+
cxx_sdk_id() -> std::string
|
336
|
+
{
|
337
|
+
return fmt::format("cxx/{}", sdk_semver());
|
338
|
+
}
|
339
|
+
} // namespace
|
340
|
+
|
319
341
|
constexpr const char* ssl_lib_id =
|
320
342
|
#if defined(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL)
|
321
343
|
"bssl"
|
@@ -329,16 +351,24 @@ user_agent_for_http(const std::string& client_id,
|
|
329
351
|
const std::string& session_id,
|
330
352
|
const std::string& extra) -> std::string
|
331
353
|
{
|
332
|
-
|
333
|
-
|
354
|
+
std::string user_agent{ has_wrapper_sdk_id() ? wrapper_sdk_id() : cxx_sdk_id() };
|
355
|
+
user_agent.append(" (");
|
356
|
+
if (has_wrapper_sdk_id()) {
|
357
|
+
user_agent.append(cxx_sdk_id()).append(";");
|
358
|
+
}
|
359
|
+
|
360
|
+
user_agent.append(fmt::format("{}/{};{}/0x{:x};client/{};session/{};{}",
|
361
|
+
COUCHBASE_CXX_CLIENT_SYSTEM_NAME,
|
362
|
+
COUCHBASE_CXX_CLIENT_SYSTEM_PROCESSOR,
|
334
363
|
ssl_lib_id,
|
335
364
|
OpenSSL_version_num(),
|
336
365
|
client_id,
|
337
366
|
session_id,
|
338
|
-
couchbase::core::meta::os());
|
367
|
+
couchbase::core::meta::os()));
|
339
368
|
if (!extra.empty()) {
|
340
369
|
user_agent.append(";").append(extra);
|
341
370
|
}
|
371
|
+
user_agent.append(")");
|
342
372
|
for (auto& ch : user_agent) {
|
343
373
|
if (ch == '\n' || ch == '\r') {
|
344
374
|
ch = ' ';
|
@@ -356,12 +386,22 @@ user_agent_for_mcbp(const std::string& client_id,
|
|
356
386
|
tao::json::value user_agent{
|
357
387
|
{ "i", fmt::format("{}/{}", client_id, session_id) },
|
358
388
|
};
|
359
|
-
|
360
|
-
|
389
|
+
std::string core_id{ has_wrapper_sdk_id() ? wrapper_sdk_id() : cxx_sdk_id() };
|
390
|
+
core_id.append(" (");
|
391
|
+
if (has_wrapper_sdk_id()) {
|
392
|
+
core_id.append(cxx_sdk_id()).append(";");
|
393
|
+
}
|
394
|
+
core_id.append(fmt::format("{}/{};{}/0x{:x}",
|
395
|
+
COUCHBASE_CXX_CLIENT_SYSTEM_NAME,
|
396
|
+
COUCHBASE_CXX_CLIENT_SYSTEM_PROCESSOR,
|
397
|
+
ssl_lib_id,
|
398
|
+
OpenSSL_version_num()));
|
361
399
|
std::string sdk_id = core_id;
|
400
|
+
core_id.append(")");
|
362
401
|
if (!extra.empty()) {
|
363
402
|
sdk_id.append(";").append(extra);
|
364
403
|
}
|
404
|
+
sdk_id.append(")");
|
365
405
|
if (max_length > 0) {
|
366
406
|
auto current_length = utils::json::generate(user_agent).size();
|
367
407
|
auto allowed_length = max_length - current_length;
|
@@ -373,7 +413,8 @@ user_agent_for_mcbp(const std::string& client_id,
|
|
373
413
|
/* user-provided string is too weird, lets just fall back to just core */
|
374
414
|
sdk_id = core_id;
|
375
415
|
} else {
|
376
|
-
sdk_id.erase(allowed_length - escaped_characters);
|
416
|
+
sdk_id.erase(allowed_length - escaped_characters - 1);
|
417
|
+
sdk_id.append(")");
|
377
418
|
}
|
378
419
|
}
|
379
420
|
}
|
@@ -116,12 +116,16 @@ analytics_request::make_response(error_context::analytics&& ctx,
|
|
116
116
|
response.ctx.ec = errc::common::parsing_failure;
|
117
117
|
return response;
|
118
118
|
}
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
119
|
+
if (const auto* i = payload.find("requestID"); i != nullptr) {
|
120
|
+
response.meta.request_id = i->get_string();
|
121
|
+
}
|
122
|
+
if (const auto* i = payload.find("clientContextID"); i != nullptr) {
|
123
|
+
response.meta.client_context_id = i->get_string();
|
124
|
+
if (response.ctx.client_context_id != response.meta.client_context_id) {
|
125
|
+
CB_LOG_WARNING(R"(unexpected clientContextID returned by service: "{}", expected "{}")",
|
126
|
+
response.meta.client_context_id,
|
127
|
+
response.ctx.client_context_id);
|
128
|
+
}
|
125
129
|
}
|
126
130
|
if (auto& status_prop = payload.at("status"); status_prop.is_string()) {
|
127
131
|
const auto& status = status_prop.get_string();
|
@@ -154,17 +158,19 @@ analytics_request::make_response(error_context::analytics&& ctx,
|
|
154
158
|
response.meta.signature = couchbase::core::utils::json::generate(*s);
|
155
159
|
}
|
156
160
|
|
157
|
-
const
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
metrics.
|
161
|
+
if (const auto* metrics = payload.find("metrics"); metrics != nullptr) {
|
162
|
+
response.meta.metrics.result_count = metrics->at("resultCount").get_unsigned();
|
163
|
+
response.meta.metrics.result_size = metrics->at("resultSize").get_unsigned();
|
164
|
+
response.meta.metrics.elapsed_time =
|
165
|
+
utils::parse_duration(metrics->at("elapsedTime").get_string());
|
166
|
+
response.meta.metrics.execution_time =
|
167
|
+
utils::parse_duration(metrics->at("executionTime").get_string());
|
168
|
+
response.meta.metrics.processed_objects = metrics->at("processedObjects").get_unsigned();
|
169
|
+
response.meta.metrics.error_count =
|
170
|
+
metrics->optional<std::uint64_t>("errorCount").value_or(0);
|
171
|
+
response.meta.metrics.warning_count =
|
172
|
+
metrics->optional<std::uint64_t>("warningCount").value_or(0);
|
173
|
+
}
|
168
174
|
|
169
175
|
if (const auto* e = payload.find("errors"); e != nullptr) {
|
170
176
|
for (const auto& err : e->get_array()) {
|
@@ -44,6 +44,8 @@ struct append_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::append_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::append_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "append";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::vector<std::byte> value;
|
49
51
|
std::uint16_t partition{};
|
@@ -45,6 +45,8 @@ struct decrement_request {
|
|
45
45
|
using encoded_request_type = protocol::client_request<protocol::decrement_request_body>;
|
46
46
|
using encoded_response_type = protocol::client_response<protocol::decrement_response_body>;
|
47
47
|
|
48
|
+
static const inline std::string observability_identifier = "decrement";
|
49
|
+
|
48
50
|
document_id id;
|
49
51
|
std::uint16_t partition{};
|
50
52
|
std::uint32_t opaque{};
|
@@ -50,6 +50,8 @@ struct exists_request {
|
|
50
50
|
using encoded_request_type = protocol::client_request<protocol::get_meta_request_body>;
|
51
51
|
using encoded_response_type = protocol::client_response<protocol::get_meta_response_body>;
|
52
52
|
|
53
|
+
static const inline std::string observability_identifier = "exists";
|
54
|
+
|
53
55
|
document_id id;
|
54
56
|
std::uint16_t partition{};
|
55
57
|
std::uint32_t opaque{};
|
@@ -41,6 +41,8 @@ struct get_request {
|
|
41
41
|
using encoded_request_type = protocol::client_request<protocol::get_request_body>;
|
42
42
|
using encoded_response_type = protocol::client_response<protocol::get_response_body>;
|
43
43
|
|
44
|
+
static const inline std::string observability_identifier = "get";
|
45
|
+
|
44
46
|
document_id id;
|
45
47
|
std::uint16_t partition{};
|
46
48
|
std::uint32_t opaque{};
|
@@ -50,6 +50,8 @@ struct get_all_replicas_request {
|
|
50
50
|
using encoded_response_type =
|
51
51
|
core::protocol::client_response<core::protocol::get_replica_response_body>;
|
52
52
|
|
53
|
+
static const inline std::string observability_identifier = "get_all_replicas";
|
54
|
+
|
53
55
|
core::document_id id;
|
54
56
|
std::optional<std::chrono::milliseconds> timeout{};
|
55
57
|
couchbase::read_preference read_preference{ couchbase::read_preference::no_preference };
|
@@ -41,6 +41,8 @@ struct get_and_lock_request {
|
|
41
41
|
using encoded_request_type = protocol::client_request<protocol::get_and_lock_request_body>;
|
42
42
|
using encoded_response_type = protocol::client_response<protocol::get_and_lock_response_body>;
|
43
43
|
|
44
|
+
static const inline std::string observability_identifier = "get_and_lock";
|
45
|
+
|
44
46
|
document_id id;
|
45
47
|
std::uint16_t partition{};
|
46
48
|
std::uint32_t opaque{};
|
@@ -42,6 +42,8 @@ struct get_and_touch_request {
|
|
42
42
|
using encoded_request_type = protocol::client_request<protocol::get_and_touch_request_body>;
|
43
43
|
using encoded_response_type = protocol::client_response<protocol::get_and_touch_response_body>;
|
44
44
|
|
45
|
+
static const inline std::string observability_identifier = "get_and_touch";
|
46
|
+
|
45
47
|
document_id id;
|
46
48
|
std::uint16_t partition{};
|
47
49
|
std::uint32_t opaque{};
|
@@ -46,6 +46,8 @@ struct get_any_replica_request {
|
|
46
46
|
using encoded_response_type =
|
47
47
|
core::protocol::client_response<core::protocol::get_replica_response_body>;
|
48
48
|
|
49
|
+
static const inline std::string observability_identifier = "get_any_replica";
|
50
|
+
|
49
51
|
core::document_id id;
|
50
52
|
std::optional<std::chrono::milliseconds> timeout{};
|
51
53
|
couchbase::read_preference read_preference{ couchbase::read_preference::no_preference };
|
@@ -42,6 +42,8 @@ struct get_projected_request {
|
|
42
42
|
using encoded_request_type = protocol::client_request<protocol::lookup_in_request_body>;
|
43
43
|
using encoded_response_type = protocol::client_response<protocol::lookup_in_response_body>;
|
44
44
|
|
45
|
+
static const inline std::string observability_identifier = "get";
|
46
|
+
|
45
47
|
document_id id;
|
46
48
|
std::uint16_t partition{};
|
47
49
|
std::uint32_t opaque{};
|
@@ -45,6 +45,8 @@ struct increment_request {
|
|
45
45
|
using encoded_request_type = protocol::client_request<protocol::increment_request_body>;
|
46
46
|
using encoded_response_type = protocol::client_response<protocol::increment_response_body>;
|
47
47
|
|
48
|
+
static const inline std::string observability_identifier = "increment";
|
49
|
+
|
48
50
|
document_id id;
|
49
51
|
std::uint16_t partition{};
|
50
52
|
std::uint32_t opaque{};
|
@@ -44,6 +44,8 @@ struct insert_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::insert_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::insert_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "insert";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::vector<std::byte> value;
|
49
51
|
std::uint16_t partition{};
|
@@ -54,6 +54,8 @@ struct lookup_in_request {
|
|
54
54
|
using encoded_request_type = protocol::client_request<protocol::lookup_in_request_body>;
|
55
55
|
using encoded_response_type = protocol::client_response<protocol::lookup_in_response_body>;
|
56
56
|
|
57
|
+
static const inline std::string observability_identifier = "lookup_in";
|
58
|
+
|
57
59
|
document_id id;
|
58
60
|
std::uint16_t partition{};
|
59
61
|
std::uint32_t opaque{};
|
@@ -61,6 +61,8 @@ struct lookup_in_all_replicas_request {
|
|
61
61
|
using encoded_response_type =
|
62
62
|
core::protocol::client_response<core::protocol::lookup_in_replica_response_body>;
|
63
63
|
|
64
|
+
static const inline std::string observability_identifier = "lookup_in_all_replicas";
|
65
|
+
|
64
66
|
core::document_id id;
|
65
67
|
std::vector<couchbase::core::impl::subdoc::command> specs{};
|
66
68
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -59,6 +59,8 @@ struct lookup_in_any_replica_request {
|
|
59
59
|
using encoded_response_type =
|
60
60
|
core::protocol::client_response<core::protocol::lookup_in_replica_response_body>;
|
61
61
|
|
62
|
+
static const inline std::string observability_identifier = "lookup_in_any_replica";
|
63
|
+
|
62
64
|
core::document_id id;
|
63
65
|
std::vector<couchbase::core::impl::subdoc::command> specs{};
|
64
66
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -55,6 +55,8 @@ struct mutate_in_request {
|
|
55
55
|
using encoded_request_type = protocol::client_request<protocol::mutate_in_request_body>;
|
56
56
|
using encoded_response_type = protocol::client_response<protocol::mutate_in_response_body>;
|
57
57
|
|
58
|
+
static const inline std::string observability_identifier = "mutate_in";
|
59
|
+
|
58
60
|
document_id id;
|
59
61
|
std::uint16_t partition{};
|
60
62
|
std::uint32_t opaque{};
|
@@ -44,6 +44,8 @@ struct prepend_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::prepend_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::prepend_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "prepend";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::vector<std::byte> value;
|
49
51
|
std::uint16_t partition{};
|
@@ -44,6 +44,8 @@ struct remove_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::remove_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::remove_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "remove";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::uint16_t partition{};
|
49
51
|
std::uint32_t opaque{};
|
@@ -44,6 +44,8 @@ struct replace_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::replace_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::replace_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "replace";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::vector<std::byte> value;
|
49
51
|
std::uint16_t partition{};
|
@@ -116,6 +116,7 @@ struct search_request {
|
|
116
116
|
using error_context_type = error_context::search;
|
117
117
|
|
118
118
|
static const inline service_type type = service_type::search;
|
119
|
+
static const inline std::string observability_identifier = "search";
|
119
120
|
|
120
121
|
std::string index_name;
|
121
122
|
couchbase::core::json_string query;
|
@@ -39,6 +39,8 @@ struct touch_request {
|
|
39
39
|
using encoded_request_type = protocol::client_request<protocol::touch_request_body>;
|
40
40
|
using encoded_response_type = protocol::client_response<protocol::touch_response_body>;
|
41
41
|
|
42
|
+
static const inline std::string observability_identifier = "touch";
|
43
|
+
|
42
44
|
document_id id;
|
43
45
|
std::uint16_t partition{};
|
44
46
|
std::uint32_t opaque{};
|
@@ -39,6 +39,8 @@ struct unlock_request {
|
|
39
39
|
using encoded_request_type = protocol::client_request<protocol::unlock_request_body>;
|
40
40
|
using encoded_response_type = protocol::client_response<protocol::unlock_response_body>;
|
41
41
|
|
42
|
+
static const inline std::string observability_identifier = "unlock";
|
43
|
+
|
42
44
|
document_id id;
|
43
45
|
std::uint16_t partition{};
|
44
46
|
std::uint32_t opaque{};
|
@@ -44,6 +44,8 @@ struct upsert_request {
|
|
44
44
|
using encoded_request_type = protocol::client_request<protocol::upsert_request_body>;
|
45
45
|
using encoded_response_type = protocol::client_response<protocol::upsert_response_body>;
|
46
46
|
|
47
|
+
static const inline std::string observability_identifier = "upsert";
|
48
|
+
|
47
49
|
document_id id;
|
48
50
|
std::vector<std::byte> value;
|
49
51
|
std::uint16_t partition{};
|
@@ -61,6 +61,7 @@ struct document_view_request {
|
|
61
61
|
using error_context_type = error_context::view;
|
62
62
|
|
63
63
|
static const inline service_type type = service_type::view;
|
64
|
+
static const inline std::string observability_identifier = "views";
|
64
65
|
|
65
66
|
std::string bucket_name;
|
66
67
|
std::string document_name;
|
@@ -35,6 +35,8 @@ struct http_noop_request {
|
|
35
35
|
using encoded_response_type = io::http_response;
|
36
36
|
using error_context_type = error_context::http;
|
37
37
|
|
38
|
+
static const inline std::string observability_identifier = "noop";
|
39
|
+
|
38
40
|
service_type type{};
|
39
41
|
|
40
42
|
std::optional<std::string> client_context_id{};
|
@@ -39,6 +39,7 @@ struct analytics_dataset_create_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_create_dataset";
|
42
43
|
|
43
44
|
std::string dataverse_name{ "Default" };
|
44
45
|
std::string dataset_name;
|
@@ -39,6 +39,7 @@ struct analytics_dataset_drop_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_drop_dataset";
|
42
43
|
|
43
44
|
std::string dataverse_name{ "Default" };
|
44
45
|
std::string dataset_name;
|
@@ -41,6 +41,7 @@ struct analytics_dataset_get_all_request {
|
|
41
41
|
using error_context_type = error_context::http;
|
42
42
|
|
43
43
|
static const inline service_type type = service_type::analytics;
|
44
|
+
static const inline std::string observability_identifier = "manager_analytics_get_all_datasets";
|
44
45
|
|
45
46
|
std::optional<std::string> client_context_id{};
|
46
47
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -39,6 +39,7 @@ struct analytics_dataverse_create_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_create_dataverse";
|
42
43
|
|
43
44
|
std::string dataverse_name;
|
44
45
|
|
@@ -39,6 +39,7 @@ struct analytics_dataverse_drop_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_drop_dataverse";
|
42
43
|
|
43
44
|
std::string dataverse_name;
|
44
45
|
|
package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx
CHANGED
@@ -40,6 +40,8 @@ struct analytics_get_pending_mutations_request {
|
|
40
40
|
using error_context_type = error_context::http;
|
41
41
|
|
42
42
|
static const inline service_type type = service_type::analytics;
|
43
|
+
static const inline std::string observability_identifier =
|
44
|
+
"manager_analytics_get_pending_mutations";
|
43
45
|
|
44
46
|
std::optional<std::string> client_context_id{};
|
45
47
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -39,6 +39,7 @@ struct analytics_index_create_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_create_index";
|
42
43
|
|
43
44
|
std::string dataverse_name{ "Default" };
|
44
45
|
std::string dataset_name;
|
@@ -39,6 +39,7 @@ struct analytics_index_drop_request {
|
|
39
39
|
using error_context_type = error_context::http;
|
40
40
|
|
41
41
|
static const inline service_type type = service_type::analytics;
|
42
|
+
static const inline std::string observability_identifier = "manager_analytics_drop_index";
|
42
43
|
|
43
44
|
std::string dataverse_name{ "Default" };
|
44
45
|
std::string dataset_name;
|
@@ -41,6 +41,7 @@ struct analytics_index_get_all_request {
|
|
41
41
|
using error_context_type = error_context::http;
|
42
42
|
|
43
43
|
static const inline service_type type = service_type::analytics;
|
44
|
+
static const inline std::string observability_identifier = "manager_analytics_get_all_indexes";
|
44
45
|
|
45
46
|
std::optional<std::string> client_context_id{};
|
46
47
|
std::optional<std::chrono::milliseconds> timeout{};
|
@@ -43,6 +43,7 @@ struct analytics_link_connect_request {
|
|
43
43
|
using error_context_type = error_context::http;
|
44
44
|
|
45
45
|
static const inline service_type type = service_type::analytics;
|
46
|
+
static const inline std::string observability_identifier = "manager_analytics_connect_link";
|
46
47
|
|
47
48
|
std::string dataverse_name{ "Default" };
|
48
49
|
std::string link_name{ "Local" };
|
@@ -51,6 +51,7 @@ struct analytics_link_create_request {
|
|
51
51
|
using error_context_type = error_context::http;
|
52
52
|
|
53
53
|
static const inline service_type type = service_type::analytics;
|
54
|
+
static const inline std::string observability_identifier = "manager_analytics_create_link";
|
54
55
|
|
55
56
|
analytics_link_type link{};
|
56
57
|
std::optional<std::string> client_context_id{};
|
@@ -43,6 +43,7 @@ struct analytics_link_disconnect_request {
|
|
43
43
|
using error_context_type = error_context::http;
|
44
44
|
|
45
45
|
static const inline service_type type = service_type::analytics;
|
46
|
+
static const inline std::string observability_identifier = "manager_analytics_disconnect_link";
|
46
47
|
|
47
48
|
std::string dataverse_name{ "Default" };
|
48
49
|
std::string link_name{ "Local" };
|
@@ -43,6 +43,7 @@ struct analytics_link_drop_request {
|
|
43
43
|
using error_context_type = error_context::http;
|
44
44
|
|
45
45
|
static const inline service_type type = service_type::analytics;
|
46
|
+
static const inline std::string observability_identifier = "manager_analytics_drop_link";
|
46
47
|
|
47
48
|
std::string link_name{};
|
48
49
|
std::string dataverse_name{};
|