couchbase 4.4.2 → 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 +13 -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 +18 -13
- 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 +177 -10
- package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
- package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
- 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/agent_group.cxx +8 -0
- package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
- package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
- package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
- package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
- package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
- package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
- package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
- package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
- package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
- package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
- package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
- package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
- package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
- 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_poll.cxx +13 -5
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
- 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/query_index_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
- package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
- package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
- package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
- package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
- package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
- 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/metrics/meter_wrapper.cxx +188 -0
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
- 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.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
- 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.cxx +3 -1
- 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.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
- 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.cxx +3 -3
- 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.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
- 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.cxx +3 -2
- 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.cxx +3 -2
- 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.cxx +3 -2
- 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.cxx +3 -2
- 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.cxx +5 -2
- 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.cxx +5 -2
- 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.cxx +4 -2
- 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.cxx +3 -2
- 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.cxx +5 -2
- 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.cxx +2 -1
- 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.cxx +2 -1
- 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.cxx +3 -1
- 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.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
- package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
- package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
- package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
- package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
- package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -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 +57 -56
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
- 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/core/transactions/transactions.cxx +2 -2
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
- package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
- package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
- package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
- 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/binding.cpp +13 -13
- 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
@@ -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
|
}
|
@@ -0,0 +1,188 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2024. Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include "meter_wrapper.hxx"
|
19
|
+
|
20
|
+
#include <couchbase/error_codes.hxx>
|
21
|
+
|
22
|
+
#include <mutex>
|
23
|
+
#include <system_error>
|
24
|
+
|
25
|
+
namespace couchbase::core::metrics
|
26
|
+
{
|
27
|
+
namespace
|
28
|
+
{
|
29
|
+
auto
|
30
|
+
snake_case_to_camel_case(const std::string& s) -> std::string
|
31
|
+
{
|
32
|
+
std::string res{};
|
33
|
+
bool capitalize{ true }; // First letter should be capitalized
|
34
|
+
for (const char c : s) {
|
35
|
+
if (c == '_') {
|
36
|
+
capitalize = true; // Next letter should be capitalized
|
37
|
+
continue;
|
38
|
+
}
|
39
|
+
if (capitalize) {
|
40
|
+
res += static_cast<char>(std::toupper(c));
|
41
|
+
capitalize = false;
|
42
|
+
} else {
|
43
|
+
res += c;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
return res;
|
47
|
+
}
|
48
|
+
|
49
|
+
auto
|
50
|
+
extract_error_name(std::error_code ec) -> std::string
|
51
|
+
{
|
52
|
+
const std::string::size_type pos = ec.message().find(' ');
|
53
|
+
if (pos != std::string::npos) {
|
54
|
+
return ec.message().substr(0, pos);
|
55
|
+
}
|
56
|
+
return ec.message();
|
57
|
+
}
|
58
|
+
|
59
|
+
auto
|
60
|
+
service_to_string(service_type s) -> std::string
|
61
|
+
{
|
62
|
+
switch (s) {
|
63
|
+
case service_type::analytics:
|
64
|
+
return "analytics";
|
65
|
+
case service_type::search:
|
66
|
+
return "search";
|
67
|
+
case service_type::key_value:
|
68
|
+
return "kv";
|
69
|
+
case service_type::management:
|
70
|
+
return "management";
|
71
|
+
case service_type::eventing:
|
72
|
+
return "eventing";
|
73
|
+
case service_type::query:
|
74
|
+
return "query";
|
75
|
+
case service_type::view:
|
76
|
+
return "views";
|
77
|
+
}
|
78
|
+
return {};
|
79
|
+
}
|
80
|
+
|
81
|
+
auto
|
82
|
+
get_standardized_outcome(std::error_code ec) -> std::string
|
83
|
+
{
|
84
|
+
if (!ec) {
|
85
|
+
return "Success";
|
86
|
+
}
|
87
|
+
|
88
|
+
// SDK-specific errors
|
89
|
+
if (ec.value() >= 1000) {
|
90
|
+
return "CouchbaseError";
|
91
|
+
}
|
92
|
+
|
93
|
+
// Errors where message and RFC-message don't match
|
94
|
+
if (ec == errc::field_level_encryption::generic_cryptography_failure) {
|
95
|
+
return "CryptoError";
|
96
|
+
}
|
97
|
+
|
98
|
+
return snake_case_to_camel_case(extract_error_name(ec));
|
99
|
+
}
|
100
|
+
} // namespace
|
101
|
+
|
102
|
+
auto
|
103
|
+
metric_attributes::encode() const -> std::map<std::string, std::string>
|
104
|
+
{
|
105
|
+
std::map<std::string, std::string> tags = { { "db.couchbase.service",
|
106
|
+
service_to_string(service) },
|
107
|
+
{ "db.operation", operation },
|
108
|
+
{ "outcome", get_standardized_outcome(ec) } };
|
109
|
+
|
110
|
+
if (internal.cluster_name.has_value()) {
|
111
|
+
tags.emplace("db.couchbase.cluster_name", internal.cluster_name.value());
|
112
|
+
}
|
113
|
+
if (internal.cluster_uuid.has_value()) {
|
114
|
+
tags.emplace("db.couchbase.cluster_uuid", internal.cluster_uuid.value());
|
115
|
+
}
|
116
|
+
if (bucket_name) {
|
117
|
+
tags.emplace("db.name", bucket_name.value());
|
118
|
+
}
|
119
|
+
if (scope_name) {
|
120
|
+
tags.emplace("db.couchbase.scope", scope_name.value());
|
121
|
+
}
|
122
|
+
if (collection_name) {
|
123
|
+
tags.emplace("db.couchbase.collection", collection_name.value());
|
124
|
+
}
|
125
|
+
|
126
|
+
return tags;
|
127
|
+
}
|
128
|
+
|
129
|
+
meter_wrapper::meter_wrapper(std::shared_ptr<couchbase::metrics::meter> meter)
|
130
|
+
: meter_{ std::move(meter) }
|
131
|
+
{
|
132
|
+
}
|
133
|
+
|
134
|
+
void
|
135
|
+
meter_wrapper::start()
|
136
|
+
{
|
137
|
+
meter_->start();
|
138
|
+
}
|
139
|
+
|
140
|
+
void
|
141
|
+
meter_wrapper::stop()
|
142
|
+
{
|
143
|
+
meter_->stop();
|
144
|
+
}
|
145
|
+
|
146
|
+
void
|
147
|
+
meter_wrapper::record_value(metric_attributes attrs,
|
148
|
+
std::chrono::steady_clock::time_point start_time)
|
149
|
+
{
|
150
|
+
static const std::string meter_name{ "db.couchbase.operations" };
|
151
|
+
|
152
|
+
{
|
153
|
+
const std::shared_lock lock{ cluster_labels_mutex_ };
|
154
|
+
|
155
|
+
if (cluster_name_) {
|
156
|
+
attrs.internal.cluster_name = cluster_name_;
|
157
|
+
}
|
158
|
+
if (cluster_uuid_) {
|
159
|
+
attrs.internal.cluster_uuid = cluster_uuid_;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
auto tags = attrs.encode();
|
164
|
+
meter_->get_value_recorder(meter_name, tags)
|
165
|
+
->record_value(std::chrono::duration_cast<std::chrono::microseconds>(
|
166
|
+
std::chrono::steady_clock::now() - start_time)
|
167
|
+
.count());
|
168
|
+
}
|
169
|
+
|
170
|
+
void
|
171
|
+
meter_wrapper::update_config(topology::configuration config)
|
172
|
+
{
|
173
|
+
const std::scoped_lock<std::shared_mutex> lock{ cluster_labels_mutex_ };
|
174
|
+
if (config.cluster_uuid.has_value()) {
|
175
|
+
cluster_uuid_ = config.cluster_uuid;
|
176
|
+
}
|
177
|
+
if (config.cluster_name.has_value()) {
|
178
|
+
cluster_name_ = config.cluster_name;
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
auto
|
183
|
+
meter_wrapper::create(std::shared_ptr<couchbase::metrics::meter> meter)
|
184
|
+
-> std::shared_ptr<meter_wrapper>
|
185
|
+
{
|
186
|
+
return std::make_shared<meter_wrapper>(std::move(meter));
|
187
|
+
}
|
188
|
+
} // namespace couchbase::core::metrics
|
@@ -0,0 +1,73 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2024. Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include "core/config_listener.hxx"
|
21
|
+
#include "core/service_type.hxx"
|
22
|
+
#include "core/topology/configuration.hxx"
|
23
|
+
|
24
|
+
#include <couchbase/metrics/meter.hxx>
|
25
|
+
|
26
|
+
#include <chrono>
|
27
|
+
#include <map>
|
28
|
+
#include <optional>
|
29
|
+
#include <shared_mutex>
|
30
|
+
#include <string>
|
31
|
+
#include <system_error>
|
32
|
+
|
33
|
+
namespace couchbase::core::metrics
|
34
|
+
{
|
35
|
+
struct metric_attributes {
|
36
|
+
couchbase::core::service_type service;
|
37
|
+
std::string operation;
|
38
|
+
std::error_code ec;
|
39
|
+
std::optional<std::string> bucket_name{};
|
40
|
+
std::optional<std::string> scope_name{};
|
41
|
+
std::optional<std::string> collection_name{};
|
42
|
+
|
43
|
+
struct {
|
44
|
+
std::optional<std::string> cluster_name{};
|
45
|
+
std::optional<std::string> cluster_uuid{};
|
46
|
+
} internal{};
|
47
|
+
|
48
|
+
[[nodiscard]] auto encode() const -> std::map<std::string, std::string>;
|
49
|
+
};
|
50
|
+
|
51
|
+
class meter_wrapper : public config_listener
|
52
|
+
{
|
53
|
+
public:
|
54
|
+
explicit meter_wrapper(std::shared_ptr<couchbase::metrics::meter> meter);
|
55
|
+
|
56
|
+
void start();
|
57
|
+
void stop();
|
58
|
+
|
59
|
+
void record_value(metric_attributes attrs, std::chrono::steady_clock::time_point start_time);
|
60
|
+
|
61
|
+
void update_config(topology::configuration config) override;
|
62
|
+
|
63
|
+
[[nodiscard]] static auto create(std::shared_ptr<couchbase::metrics::meter> meter)
|
64
|
+
-> std::shared_ptr<meter_wrapper>;
|
65
|
+
|
66
|
+
private:
|
67
|
+
std::shared_ptr<couchbase::metrics::meter> meter_;
|
68
|
+
|
69
|
+
std::optional<std::string> cluster_name_{};
|
70
|
+
std::optional<std::string> cluster_uuid_{};
|
71
|
+
std::shared_mutex cluster_labels_mutex_{};
|
72
|
+
};
|
73
|
+
} // namespace couchbase::core::metrics
|
@@ -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;
|