couchbase 4.4.2 → 4.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +13 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
  13. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
  14. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  15. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
  16. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  17. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  21. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  22. package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
  23. package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
  24. package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
  25. package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
  26. package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
  27. package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
  28. package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
  29. package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
  30. package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
  31. package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
  32. package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
  33. package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
  34. package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
  36. package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
  37. package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
  38. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  39. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
  40. package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
  41. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
  42. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
  43. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
  44. package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
  45. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
  46. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  47. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
  50. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
  51. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  52. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  53. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
  54. package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
  55. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  56. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
  57. package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
  58. package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
  59. package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
  60. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
  61. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
  62. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
  63. package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
  64. package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
  65. package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
  66. package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
  67. package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
  68. package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
  69. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  70. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  71. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
  72. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
  73. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  74. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  75. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  79. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  83. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  85. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  91. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  92. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  93. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  94. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  95. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  96. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  97. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  98. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  99. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  114. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  115. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
  118. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
  120. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
  122. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
  124. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
  127. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  129. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
  132. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
  134. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  135. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
  136. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  137. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  138. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  139. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  140. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  141. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  142. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  143. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  144. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  145. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  146. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  147. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  148. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  149. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  150. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  151. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
  152. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  153. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  154. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  155. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  156. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  157. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  158. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  159. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  160. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
  161. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  162. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
  163. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  164. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
  165. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  166. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  167. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
  168. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  169. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
  170. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  171. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
  172. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  173. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
  174. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  175. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
  176. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  177. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
  178. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  179. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
  180. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  181. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
  182. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  183. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  184. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
  185. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  186. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  187. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  188. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  189. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  190. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  191. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
  192. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  193. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
  194. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  195. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
  196. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  197. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
  198. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  199. package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
  200. package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
  201. package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
  202. package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
  203. package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
  204. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
  205. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
  206. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
  207. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
  208. package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
  209. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
  210. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
  211. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  212. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  213. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
  214. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
  215. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
  216. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  217. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  218. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
  219. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
  220. package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
  221. package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
  222. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  223. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  224. package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
  225. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
  226. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
  227. package/dist/analyticsindexmanager.d.ts +98 -14
  228. package/dist/analyticsindexmanager.js +452 -411
  229. package/dist/binding.d.ts +53 -4
  230. package/dist/bindingutilities.d.ts +26 -1
  231. package/dist/bindingutilities.js +108 -1
  232. package/dist/couchbase.d.ts +3 -1
  233. package/dist/couchbase.js +2 -0
  234. package/dist/rangeScan.d.ts +1 -1
  235. package/dist/rangeScan.js +1 -1
  236. package/dist/transactions.d.ts +34 -3
  237. package/dist/transactions.js +25 -18
  238. package/dist/transcoders.d.ts +68 -0
  239. package/dist/transcoders.js +194 -1
  240. package/dist/usermanager.d.ts +14 -14
  241. package/dist/usermanager.js +178 -228
  242. package/dist/utilities.js +4 -6
  243. package/dist/utilities_internal.js +1 -2
  244. package/package.json +9 -8
  245. package/src/binding.cpp +13 -13
  246. package/src/connection.cpp +22 -0
  247. package/src/connection.hpp +12 -0
  248. package/src/connection_autogen.cpp +100 -0
  249. package/src/jstocbpp_autogen.hpp +315 -8
  250. package/src/jstocbpp_transactions.hpp +1 -2
  251. package/tools/gen-bindings-js.js +38 -3
  252. 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
- auto user_agent = fmt::format("{};{}/0x{:x};client/{};session/{};{}",
333
- couchbase::core::meta::sdk_id(),
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
- const std::string core_id =
360
- fmt::format("{};{}/0x{:x}", couchbase::core::meta::sdk_id(), ssl_lib_id, OpenSSL_version_num());
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
- response.meta.request_id = payload.at("requestID").get_string();
120
- response.meta.client_context_id = payload.at("clientContextID").get_string();
121
- if (response.ctx.client_context_id != response.meta.client_context_id) {
122
- CB_LOG_WARNING(R"(unexpected clientContextID returned by service: "{}", expected "{}")",
123
- response.meta.client_context_id,
124
- response.ctx.client_context_id);
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 tao::json::value& metrics = payload.at("metrics");
158
- response.meta.metrics.result_count = metrics.at("resultCount").get_unsigned();
159
- response.meta.metrics.result_size = metrics.at("resultSize").get_unsigned();
160
- response.meta.metrics.elapsed_time =
161
- utils::parse_duration(metrics.at("elapsedTime").get_string());
162
- response.meta.metrics.execution_time =
163
- utils::parse_duration(metrics.at("executionTime").get_string());
164
- response.meta.metrics.processed_objects = metrics.at("processedObjects").get_unsigned();
165
- response.meta.metrics.error_count = metrics.optional<std::uint64_t>("errorCount").value_or(0);
166
- response.meta.metrics.warning_count =
167
- metrics.optional<std::uint64_t>("warningCount").value_or(0);
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()) {
@@ -80,6 +80,7 @@ struct analytics_request {
80
80
  using error_context_type = error_context::analytics;
81
81
 
82
82
  static const inline service_type type = service_type::analytics;
83
+ static const inline std::string observability_identifier = "analytics";
83
84
 
84
85
  std::string statement;
85
86
 
@@ -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{};
@@ -80,6 +80,7 @@ struct query_request {
80
80
  using error_context_type = error_context::query;
81
81
 
82
82
  static const inline service_type type = service_type::query;
83
+ static const inline std::string observability_identifier = "query";
83
84
 
84
85
  std::string statement;
85
86
 
@@ -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;