couchbase 3.7.0 → 3.8.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/CMakeLists.txt +4 -1
- data/ext/cache/extconf_include.rb +4 -3
- data/ext/cache/mozilla-ca-bundle.crt +66 -93
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/couchbase/CMakeLists.txt +24 -11
- data/ext/couchbase/cmake/APKBUILD.in +17 -1
- data/ext/couchbase/cmake/Bundler.cmake +9 -1
- data/ext/couchbase/cmake/Cache.cmake +48 -19
- data/ext/couchbase/cmake/CompilerOptions.cmake +3 -1
- data/ext/couchbase/cmake/OpenSSL.cmake +10 -2
- data/ext/couchbase/cmake/Packaging.cmake +48 -8
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +43 -1
- data/ext/couchbase/cmake/build_config.hxx.in +2 -0
- data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +18 -0
- data/ext/couchbase/cmake/tarball_glob.txt +10 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +1 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +45 -43
- data/ext/couchbase/core/app_telemetry_reporter.hxx +4 -3
- data/ext/couchbase/core/bucket.cxx +128 -13
- data/ext/couchbase/core/bucket.hxx +12 -2
- data/ext/couchbase/core/cluster.cxx +304 -152
- data/ext/couchbase/core/cluster.hxx +32 -0
- data/ext/couchbase/core/cluster_credentials.cxx +25 -0
- data/ext/couchbase/core/cluster_credentials.hxx +5 -0
- data/ext/couchbase/core/cluster_label_listener.cxx +72 -0
- data/ext/couchbase/core/cluster_label_listener.hxx +46 -0
- data/ext/couchbase/core/cluster_options.hxx +4 -0
- data/ext/couchbase/core/deprecation_utils.hxx +26 -0
- data/ext/couchbase/core/error.hxx +27 -0
- data/ext/couchbase/core/free_form_http_request.hxx +0 -2
- data/ext/couchbase/core/http_component.cxx +12 -48
- data/ext/couchbase/core/impl/analytics.cxx +3 -2
- data/ext/couchbase/core/impl/analytics.hxx +2 -1
- data/ext/couchbase/core/impl/analytics_index_manager.cxx +249 -137
- data/ext/couchbase/core/impl/binary_collection.cxx +134 -58
- data/ext/couchbase/core/impl/bucket_manager.cxx +87 -35
- data/ext/couchbase/core/impl/collection.cxx +560 -245
- data/ext/couchbase/core/impl/collection_manager.cxx +89 -49
- data/ext/couchbase/core/impl/dns_srv_tracker.cxx +4 -4
- data/ext/couchbase/core/impl/error.cxx +20 -13
- data/ext/couchbase/core/impl/error.hxx +15 -10
- data/ext/couchbase/core/impl/get_all_replicas.hxx +1 -1
- data/ext/couchbase/core/impl/get_any_replica.hxx +2 -1
- data/ext/couchbase/core/impl/get_replica.hxx +2 -0
- data/ext/couchbase/core/impl/lookup_in_replica.hxx +1 -1
- data/ext/couchbase/core/impl/observability_recorder.cxx +161 -0
- data/ext/couchbase/core/impl/observability_recorder.hxx +77 -0
- data/ext/couchbase/core/impl/observe_seqno.hxx +2 -0
- data/ext/couchbase/core/impl/public_bucket.cxx +31 -7
- data/ext/couchbase/core/impl/public_cluster.cxx +107 -19
- data/ext/couchbase/core/impl/query.cxx +6 -3
- data/ext/couchbase/core/impl/query.hxx +3 -1
- data/ext/couchbase/core/impl/query_index_manager.cxx +267 -102
- data/ext/couchbase/core/impl/scope.cxx +53 -11
- data/ext/couchbase/core/impl/search.cxx +8 -4
- data/ext/couchbase/core/impl/search.hxx +6 -2
- data/ext/couchbase/core/impl/search_index_manager.cxx +131 -41
- data/ext/couchbase/core/impl/with_cancellation.hxx +75 -0
- data/ext/couchbase/core/io/config_tracker.cxx +9 -9
- data/ext/couchbase/core/io/config_tracker.hxx +2 -1
- data/ext/couchbase/core/io/http_command.hxx +98 -49
- data/ext/couchbase/core/io/http_context.hxx +2 -0
- data/ext/couchbase/core/io/http_session.cxx +23 -10
- data/ext/couchbase/core/io/http_session.hxx +17 -9
- data/ext/couchbase/core/io/http_session_manager.hxx +163 -228
- data/ext/couchbase/core/io/http_traits.hxx +0 -7
- data/ext/couchbase/core/io/mcbp_command.hxx +123 -44
- data/ext/couchbase/core/io/mcbp_session.cxx +251 -26
- data/ext/couchbase/core/io/mcbp_session.hxx +9 -1
- data/ext/couchbase/core/io/mcbp_traits.hxx +0 -8
- data/ext/couchbase/core/io/streams.cxx +3 -3
- data/ext/couchbase/core/io/streams.hxx +3 -2
- data/ext/couchbase/core/meta/features.hxx +15 -0
- data/ext/couchbase/core/meta/version.cxx +13 -0
- data/ext/couchbase/core/meta/version.hxx +3 -0
- data/ext/couchbase/core/metrics/constants.hxx +23 -0
- data/ext/couchbase/core/metrics/logging_meter.cxx +5 -5
- data/ext/couchbase/core/metrics/meter_wrapper.cxx +65 -63
- data/ext/couchbase/core/metrics/meter_wrapper.hxx +12 -10
- data/ext/couchbase/core/operations/document_analytics.hxx +0 -5
- data/ext/couchbase/core/operations/document_append.hxx +0 -4
- data/ext/couchbase/core/operations/document_decrement.hxx +0 -5
- data/ext/couchbase/core/operations/document_exists.hxx +0 -7
- data/ext/couchbase/core/operations/document_get.hxx +0 -7
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +77 -27
- data/ext/couchbase/core/operations/document_get_and_lock.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_and_touch.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_any_replica.hxx +83 -2
- data/ext/couchbase/core/operations/document_get_projected.hxx +0 -9
- data/ext/couchbase/core/operations/document_increment.hxx +0 -5
- data/ext/couchbase/core/operations/document_insert.hxx +0 -4
- data/ext/couchbase/core/operations/document_lookup_in.hxx +0 -9
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +46 -4
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +121 -43
- data/ext/couchbase/core/operations/document_mutate_in.hxx +0 -5
- data/ext/couchbase/core/operations/document_prepend.hxx +0 -4
- data/ext/couchbase/core/operations/document_query.hxx +0 -4
- data/ext/couchbase/core/operations/document_remove.hxx +0 -4
- data/ext/couchbase/core/operations/document_replace.hxx +0 -4
- data/ext/couchbase/core/operations/document_search.hxx +0 -7
- data/ext/couchbase/core/operations/document_touch.hxx +0 -7
- data/ext/couchbase/core/operations/document_unlock.hxx +0 -6
- data/ext/couchbase/core/operations/document_upsert.hxx +0 -4
- data/ext/couchbase/core/operations/document_view.cxx +2 -0
- data/ext/couchbase/core/operations/document_view.hxx +10 -13
- data/ext/couchbase/core/operations/http_noop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_flush.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/change_password.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/error_utils.cxx +4 -1
- data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_status.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/freeform.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +68 -30
- data/ext/couchbase/core/operations/management/query_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_get_all.hxx +4 -3
- data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +2 -1
- data/ext/couchbase/core/operations/management/role_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_query.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/operation_traits.hxx +6 -0
- data/ext/couchbase/core/operations.hxx +0 -1
- data/ext/couchbase/core/operations_fwd.hxx +8 -0
- data/ext/couchbase/core/origin.cxx +67 -12
- data/ext/couchbase/core/origin.hxx +13 -8
- data/ext/couchbase/core/orphan_reporter.cxx +164 -0
- data/ext/couchbase/core/orphan_reporter.hxx +65 -0
- data/ext/couchbase/core/sasl/CMakeLists.txt +1 -0
- data/ext/couchbase/core/sasl/client.cc +6 -0
- data/ext/couchbase/core/sasl/mechanism.cc +2 -1
- data/ext/couchbase/core/sasl/mechanism.h +2 -1
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.cc +41 -0
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.h +47 -0
- data/ext/couchbase/core/tls_context_provider.cxx +44 -0
- data/ext/couchbase/core/tls_context_provider.hxx +44 -0
- data/ext/couchbase/core/tracing/attribute_helpers.hxx +45 -0
- data/ext/couchbase/core/tracing/constants.hxx +148 -68
- data/ext/couchbase/core/tracing/threshold_logging_options.hxx +0 -3
- data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +122 -170
- data/ext/couchbase/core/tracing/tracer_wrapper.cxx +17 -24
- data/ext/couchbase/core/tracing/tracer_wrapper.hxx +8 -10
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.cxx +114 -0
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.hxx +85 -0
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +16 -14
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +4 -4
- data/ext/couchbase/core/transactions/transactions.cxx +1 -1
- data/ext/couchbase/core/transactions/transactions_cleanup.cxx +1 -2
- data/ext/couchbase/core/utils/byteswap.hxx +12 -0
- data/ext/couchbase/core/utils/concurrent_fixed_priority_queue.hxx +102 -0
- data/ext/couchbase/core/utils/connection_string.cxx +2 -0
- data/ext/couchbase/couchbase/certificate_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/cluster.hxx +47 -0
- data/ext/couchbase/couchbase/cluster_options.hxx +16 -0
- data/ext/couchbase/couchbase/collection.hxx +60 -15
- data/ext/couchbase/couchbase/error_codes.hxx +48 -48
- data/ext/couchbase/couchbase/jwt_authenticator.hxx +52 -0
- data/ext/couchbase/couchbase/metrics/meter.hxx +2 -1
- data/ext/couchbase/couchbase/metrics/otel_meter.hxx +75 -80
- data/ext/couchbase/couchbase/network_options.hxx +19 -0
- data/ext/couchbase/couchbase/password_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +15 -17
- data/ext/couchbase/couchbase/tracing/request_span.hxx +2 -2
- data/ext/couchbase.cxx +4 -0
- data/ext/extconf.rb +1 -0
- data/ext/rcb_analytics.cxx +157 -47
- data/ext/rcb_backend.cxx +118 -71
- data/ext/rcb_buckets.cxx +39 -16
- data/ext/rcb_collections.cxx +36 -12
- data/ext/rcb_crud.cxx +587 -294
- data/ext/rcb_hdr_histogram.cxx +219 -0
- data/ext/rcb_hdr_histogram.hxx +28 -0
- data/ext/rcb_multi.cxx +142 -59
- data/ext/rcb_observability.cxx +132 -0
- data/ext/rcb_observability.hxx +49 -0
- data/ext/rcb_query.cxx +77 -27
- data/ext/rcb_search.cxx +92 -31
- data/ext/rcb_users.cxx +69 -26
- data/ext/rcb_utils.cxx +91 -0
- data/ext/rcb_utils.hxx +141 -168
- data/ext/rcb_views.cxx +36 -12
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +37 -22
- data/lib/couchbase/bucket.rb +46 -31
- data/lib/couchbase/cluster.rb +146 -61
- data/lib/couchbase/collection.rb +257 -186
- data/lib/couchbase/datastructures/couchbase_list.rb +81 -50
- data/lib/couchbase/datastructures/couchbase_map.rb +86 -50
- data/lib/couchbase/datastructures/couchbase_queue.rb +64 -38
- data/lib/couchbase/datastructures/couchbase_set.rb +57 -41
- data/lib/couchbase/deprecations.rb +1 -1
- data/lib/couchbase/diagnostics.rb +8 -8
- data/lib/couchbase/errors.rb +6 -0
- data/lib/couchbase/management/analytics_index_manager.rb +90 -59
- data/lib/couchbase/management/bucket_manager.rb +73 -45
- data/lib/couchbase/management/collection_manager.rb +86 -43
- data/lib/couchbase/management/collection_query_index_manager.rb +56 -33
- data/lib/couchbase/management/query_index_manager.rb +88 -36
- data/lib/couchbase/management/scope_search_index_manager.rb +119 -52
- data/lib/couchbase/management/search_index_manager.rb +401 -178
- data/lib/couchbase/management/user_manager.rb +343 -174
- data/lib/couchbase/management/view_index_manager.rb +166 -73
- data/lib/couchbase/metrics/logging_meter.rb +108 -0
- data/lib/couchbase/metrics/logging_value_recorder.rb +50 -0
- data/lib/couchbase/metrics/meter.rb +27 -0
- data/lib/couchbase/metrics/noop_meter.rb +30 -0
- data/lib/couchbase/metrics/noop_value_recorder.rb +27 -0
- data/lib/couchbase/metrics/value_recorder.rb +25 -0
- data/lib/couchbase/options.rb +69 -3
- data/lib/couchbase/protostellar/cluster.rb +3 -0
- data/lib/couchbase/scope.rb +62 -48
- data/lib/couchbase/search_options.rb +18 -18
- data/lib/couchbase/tracing/noop_span.rb +29 -0
- data/lib/couchbase/tracing/noop_tracer.rb +29 -0
- data/lib/couchbase/tracing/request_span.rb +34 -0
- data/lib/couchbase/tracing/request_tracer.rb +28 -0
- data/lib/couchbase/tracing/threshold_logging_span.rb +112 -0
- data/lib/couchbase/tracing/threshold_logging_tracer.rb +231 -0
- data/lib/couchbase/utils/hdr_histogram.rb +55 -0
- data/lib/couchbase/utils/observability.rb +257 -0
- data/lib/couchbase/utils/observability_constants.rb +200 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -3
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase.rb +2 -2
- metadata +58 -6
|
@@ -84,6 +84,12 @@ add_custom_command(
|
|
|
84
84
|
set(COUCHBASE_CXX_TARBALL_THIRD_PARTY_GLOB_FILE ${PROJECT_SOURCE_DIR}/cmake/tarball_glob.txt)
|
|
85
85
|
|
|
86
86
|
if(COUCHBASE_CXX_RECORD_BUILD_INFO_FOR_TARBALL)
|
|
87
|
+
if(CPM_USE_NAMED_CACHE_DIRECTORIES)
|
|
88
|
+
get_filename_component(opentelemetry_SOURCE_DIR_PARENT "${opentelemetry_SOURCE_DIR}" DIRECTORY)
|
|
89
|
+
get_filename_component(opentelemetry_CPM_HASH "${opentelemetry_SOURCE_DIR_PARENT}" NAME)
|
|
90
|
+
else()
|
|
91
|
+
get_filename_component(opentelemetry_CPM_HASH "${opentelemetry_SOURCE_DIR}" NAME)
|
|
92
|
+
endif()
|
|
87
93
|
file(
|
|
88
94
|
WRITE "${CMAKE_SOURCE_DIR}/cmake/TarballRelease.cmake"
|
|
89
95
|
"
|
|
@@ -91,6 +97,7 @@ set(CPM_DOWNLOAD_ALL OFF CACHE BOOL \"\" FORCE)
|
|
|
91
97
|
set(CPM_USE_NAMED_CACHE_DIRECTORIES ON CACHE BOOL \"\" FORCE)
|
|
92
98
|
set(CPM_USE_LOCAL_PACKAGES OFF CACHE BOOL \"\" FORCE)
|
|
93
99
|
set(CPM_SOURCE_CACHE \"\${PROJECT_SOURCE_DIR}/third_party_cache\" CACHE STRING \"\" FORCE)
|
|
100
|
+
set(OTELCPP_PROTO_PATH \"\${PROJECT_SOURCE_DIR}/third_party_cache/opentelemetry/${opentelemetry_CPM_HASH}/opentelemetry/third_party/opentelemetry-proto\" CACHE STRING \"\" FORCE)
|
|
94
101
|
set(COUCHBASE_CXX_CLIENT_GIT_REVISION \"${COUCHBASE_CXX_CLIENT_GIT_REVISION}\")
|
|
95
102
|
set(COUCHBASE_CXX_CLIENT_GIT_DESCRIBE \"${COUCHBASE_CXX_CLIENT_GIT_DESCRIBE}\")
|
|
96
103
|
set(COUCHBASE_CXX_CLIENT_BUILD_TIMESTAMP \"${COUCHBASE_CXX_CLIENT_BUILD_TIMESTAMP}\")
|
|
@@ -112,16 +119,36 @@ add_custom_command(
|
|
|
112
119
|
-DCPM_SOURCE_CACHE="${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache"
|
|
113
120
|
-DCOUCHBASE_CXX_CLIENT_EMBED_MOZILLA_CA_BUNDLE_ROOT="${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache"
|
|
114
121
|
-DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF -DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON -DCOUCHBASE_CXX_CLIENT_BUILD_DOCS=OFF
|
|
122
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY=ON
|
|
115
123
|
-DCOUCHBASE_CXX_CLIENT_STATIC_BORINGSSL=ON -DCPM_DOWNLOAD_ALL=ON -DCPM_USE_NAMED_CACHE_DIRECTORIES=ON
|
|
116
124
|
-DCPM_USE_LOCAL_PACKAGES=OFF -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=ON -DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON
|
|
117
125
|
-DCOUCHBASE_CXX_CLIENT_INSTALL=ON -DCOUCHBASE_CXX_RECORD_BUILD_INFO_FOR_TARBALL=ON
|
|
118
126
|
COMMAND
|
|
119
|
-
${XARGS}
|
|
127
|
+
${XARGS} -a ${COUCHBASE_CXX_TARBALL_THIRD_PARTY_GLOB_FILE} -I {} find
|
|
120
128
|
"${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache" -wholename "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache/{}"
|
|
121
|
-
-type f
|
|
129
|
+
-type f
|
|
130
|
+
| grep -v
|
|
131
|
+
-e "/benchmark"
|
|
132
|
+
-e "/opentelemetry.*/functional"
|
|
133
|
+
-e "/opentelemetry.*/install"
|
|
134
|
+
-e "/opentelemetry.*/test"
|
|
135
|
+
-e "/opentelemetry/examples"
|
|
136
|
+
-e "/opentelemetry/docker"
|
|
137
|
+
-e "/opentelemetry/exporters/elasticsearch"
|
|
138
|
+
-e "/opentelemetry/exporters/etw"
|
|
139
|
+
-e "/opentelemetry/exporters/prometheus"
|
|
140
|
+
-e "/opentelemetry/exporters/zipkin"
|
|
141
|
+
-e "/opentelemetry/opentracing-.*"
|
|
142
|
+
-e "/opentelemetry/third_party/ms-gsl"
|
|
143
|
+
-e "/opentelemetry/third_party/nlohmann-json"
|
|
144
|
+
-e "/opentelemetry/third_party/prometheus-cpp"
|
|
145
|
+
-e "/opentelemetry/tools"
|
|
146
|
+
-e "crypto_test_data"
|
|
147
|
+
-e "googletest"
|
|
148
|
+
| uniq >
|
|
122
149
|
"${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/third_party_manifest.txt"
|
|
123
150
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/filtered_cache"
|
|
124
|
-
COMMAND ${XARGS}
|
|
151
|
+
COMMAND ${XARGS} -a "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/third_party_manifest.txt" -I {} ${CP} --parents
|
|
125
152
|
{} "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/filtered_cache"
|
|
126
153
|
COMMAND
|
|
127
154
|
${CMAKE_COMMAND} -E rename
|
|
@@ -263,7 +290,7 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
|
|
|
263
290
|
set(COUCHBASE_CXX_CLIENT_SPEC "${PROJECT_BINARY_DIR}/packaging/couchbase-cxx-client.spec")
|
|
264
291
|
configure_file(${PROJECT_SOURCE_DIR}/cmake/couchbase-cxx-client.spec.in "${COUCHBASE_CXX_CLIENT_SPEC}" @ONLY)
|
|
265
292
|
|
|
266
|
-
set(COUCHBASE_CXX_CLIENT_DEFAULT_ROOT "rocky-9-${CMAKE_SYSTEM_PROCESSOR}")
|
|
293
|
+
set(COUCHBASE_CXX_CLIENT_DEFAULT_ROOT "rocky+epel-9-${CMAKE_SYSTEM_PROCESSOR}")
|
|
267
294
|
set(COUCHBASE_CXX_CLIENT_RPM_NAME
|
|
268
295
|
"couchbase-cxx-client-${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}-${COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE}")
|
|
269
296
|
set(COUCHBASE_CXX_CLIENT_SRPM "${PROJECT_BINARY_DIR}/packaging/srpm/${COUCHBASE_CXX_CLIENT_RPM_NAME}.el9.src.rpm")
|
|
@@ -282,9 +309,9 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
|
|
|
282
309
|
APPEND
|
|
283
310
|
COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS
|
|
284
311
|
"opensuse-leap-15.6-${CMAKE_SYSTEM_PROCESSOR}"
|
|
285
|
-
"rocky-10-${CMAKE_SYSTEM_PROCESSOR}"
|
|
286
|
-
"rocky-9-${CMAKE_SYSTEM_PROCESSOR}"
|
|
287
|
-
"rocky-8-${CMAKE_SYSTEM_PROCESSOR}"
|
|
312
|
+
"rocky+epel-10-${CMAKE_SYSTEM_PROCESSOR}"
|
|
313
|
+
"rocky+epel-9-${CMAKE_SYSTEM_PROCESSOR}"
|
|
314
|
+
"rocky+epel-8-${CMAKE_SYSTEM_PROCESSOR}"
|
|
288
315
|
"amazonlinux-2023-${CMAKE_SYSTEM_PROCESSOR}"
|
|
289
316
|
"fedora-43-${CMAKE_SYSTEM_PROCESSOR}"
|
|
290
317
|
"fedora-42-${CMAKE_SYSTEM_PROCESSOR}"
|
|
@@ -327,8 +354,21 @@ if(COUCHBASE_CXX_CLIENT_APK_TARGETS)
|
|
|
327
354
|
set(COUCHBASE_CXX_CLIENT_TARBALL_ALPINE
|
|
328
355
|
"${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE}.tar.gz")
|
|
329
356
|
if(${COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS} GREATER 0)
|
|
357
|
+
# Encode commit count and git hash into _p version for uniqueness
|
|
358
|
+
# Extract first 3 bytes from git hash (7-char short hash), convert to decimal
|
|
359
|
+
# Map each byte mod 100 to create 6-digit suffix
|
|
360
|
+
# Formula: p = commits × 10_000_000 + (byte1%100)*10000 + (byte2%100)*100 + (byte3%100)
|
|
361
|
+
# Example: 1.2.0-75-gfeb729b2 → 1.2.0_p750548341
|
|
362
|
+
string(SUBSTRING "${COUCHBASE_CXX_CLIENT_GIT_REVISION_SHORT}" 0 2 _b1_hex)
|
|
363
|
+
string(SUBSTRING "${COUCHBASE_CXX_CLIENT_GIT_REVISION_SHORT}" 2 2 _b2_hex)
|
|
364
|
+
string(SUBSTRING "${COUCHBASE_CXX_CLIENT_GIT_REVISION_SHORT}" 4 2 _b3_hex)
|
|
365
|
+
math(EXPR _b1 "0x${_b1_hex}")
|
|
366
|
+
math(EXPR _b2 "0x${_b2_hex}")
|
|
367
|
+
math(EXPR _b3 "0x${_b3_hex}")
|
|
368
|
+
math(EXPR _sha_pack "(${_b1} % 100) * 10000 + (${_b2} % 100) * 100 + (${_b3} % 100)")
|
|
369
|
+
math(EXPR _p_version "${COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS} * 10000000 + ${_sha_pack}")
|
|
330
370
|
set(COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE
|
|
331
|
-
"couchbase-cxx-client-${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}_p${
|
|
371
|
+
"couchbase-cxx-client-${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}_p${_p_version}")
|
|
332
372
|
set(COUCHBASE_CXX_CLIENT_TARBALL_ALPINE
|
|
333
373
|
"${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE}.tar.gz")
|
|
334
374
|
endif()
|
|
@@ -39,6 +39,46 @@ if(NOT TARGET spdlog::spdlog)
|
|
|
39
39
|
"SPDLOG_FMT_EXTERNAL OFF")
|
|
40
40
|
endif()
|
|
41
41
|
|
|
42
|
+
if(COUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY)
|
|
43
|
+
if(NOT TARGET opentelemetry)
|
|
44
|
+
# Disable curl HTTP client to avoid curl downloading and linking to BoringSSL
|
|
45
|
+
# OpenTelemetry will fall back to using its own HTTP client implementation
|
|
46
|
+
# This avoids CMake export errors when curl tries to reference ssl/crypto targets
|
|
47
|
+
|
|
48
|
+
# https://github.com/open-telemetry/opentelemetry-cpp/releases
|
|
49
|
+
cpmaddpackage(
|
|
50
|
+
NAME
|
|
51
|
+
opentelemetry
|
|
52
|
+
VERSION
|
|
53
|
+
1.23.0
|
|
54
|
+
GITHUB_REPOSITORY
|
|
55
|
+
"open-telemetry/opentelemetry-cpp"
|
|
56
|
+
EXCLUDE_FROM_ALL ON
|
|
57
|
+
OPTIONS
|
|
58
|
+
"protobuf_MSVC_STATIC_RUNTIME OFF"
|
|
59
|
+
"OPENTELEMETRY_INSTALL OFF"
|
|
60
|
+
"WITH_ABI_VERSION_1 OFF"
|
|
61
|
+
"WITH_ABI_VERSION_2 ON"
|
|
62
|
+
"WITH_BENCHMARK OFF"
|
|
63
|
+
"WITH_EXAMPLES OFF"
|
|
64
|
+
"WITH_FUNC_TESTS OFF"
|
|
65
|
+
"WITH_OTLP_GRPC OFF"
|
|
66
|
+
"WITH_OTLP_HTTP ON"
|
|
67
|
+
"WITH_HTTP_CLIENT_CURL OFF"
|
|
68
|
+
"WITH_PROMETHEUS OFF"
|
|
69
|
+
"WITH_OPENTRACING OFF"
|
|
70
|
+
"WITH_STL CXX17"
|
|
71
|
+
"BUILD_TESTING OFF"
|
|
72
|
+
"BUILD_SHARED_LIBS OFF"
|
|
73
|
+
"CMAKE_C_VISIBILITY_PRESET hidden"
|
|
74
|
+
"CMAKE_CXX_VISIBILITY_PRESET hidden"
|
|
75
|
+
"CMAKE_POSITION_INDEPENDENT_CODE ON")
|
|
76
|
+
endif()
|
|
77
|
+
|
|
78
|
+
declare_system_library(opentelemetry_exporter_otlp_http)
|
|
79
|
+
declare_system_library(opentelemetry_exporter_otlp_http_metric)
|
|
80
|
+
endif()
|
|
81
|
+
|
|
42
82
|
if(NOT TARGET Microsoft.GSL::GSL)
|
|
43
83
|
# https://github.com/microsoft/GSL/releases
|
|
44
84
|
cpmaddpackage(
|
|
@@ -185,8 +225,9 @@ if(asio_ADDED)
|
|
|
185
225
|
target_link_libraries(asio PRIVATE Threads::Threads)
|
|
186
226
|
if(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL)
|
|
187
227
|
target_link_libraries(asio PUBLIC $<TARGET_OBJECTS:ssl> $<TARGET_OBJECTS:crypto>)
|
|
228
|
+
# Add BoringSSL include directories before asio's own include directories.
|
|
188
229
|
target_include_directories(
|
|
189
|
-
asio
|
|
230
|
+
asio BEFORE PRIVATE $<BUILD_INTERFACE:$<TARGET_PROPERTY:ssl,INTERFACE_INCLUDE_DIRECTORIES>>
|
|
190
231
|
$<BUILD_INTERFACE:$<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>>)
|
|
191
232
|
elseif(NOT COUCHBASE_CXX_CLIENT_POST_LINKED_OPENSSL)
|
|
192
233
|
target_link_libraries(asio PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
|
@@ -264,3 +305,4 @@ declare_system_library(Microsoft.GSL::GSL)
|
|
|
264
305
|
declare_system_library(spdlog::spdlog)
|
|
265
306
|
declare_system_library(asio)
|
|
266
307
|
declare_system_library(taocpp::json)
|
|
308
|
+
declare_system_library(snappy)
|
|
@@ -24,3 +24,5 @@
|
|
|
24
24
|
#cmakedefine COUCHBASE_CXX_CLIENT_BORINGSSL_SHA "@COUCHBASE_CXX_CLIENT_BORINGSSL_SHA@"
|
|
25
25
|
#cmakedefine COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL
|
|
26
26
|
#cmakedefine COUCHBASE_CXX_CLIENT_COLUMNAR
|
|
27
|
+
#cmakedefine COUCHBASE_CXX_CLIENT_CREATE_OPERATION_SPAN_IN_CORE
|
|
28
|
+
#cmakedefine COUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY
|
|
@@ -12,6 +12,19 @@ BuildRequires: gcc13, gcc13-c++
|
|
|
12
12
|
BuildRequires: gcc, gcc-c++
|
|
13
13
|
%endif
|
|
14
14
|
BuildRequires: cmake >= 3.19
|
|
15
|
+
%if 0%{?suse_version} > 0
|
|
16
|
+
BuildRequires: libcurl-devel
|
|
17
|
+
BuildRequires: protobuf-devel
|
|
18
|
+
BuildRequires: nlohmann_json-devel
|
|
19
|
+
%else
|
|
20
|
+
%if 0%{?amzn} == 0 && (0%{?rhel} >= 9 || 0%{?fedora} > 0)
|
|
21
|
+
BuildRequires: curl-devel
|
|
22
|
+
BuildRequires: protobuf-devel
|
|
23
|
+
BuildRequires: json-devel
|
|
24
|
+
%else
|
|
25
|
+
# CentOS 8 / Rocky 8 - skip these packages (no OpenTelemetry)
|
|
26
|
+
%endif
|
|
27
|
+
%endif
|
|
15
28
|
Source0: @COUCHBASE_CXX_CLIENT_TARBALL_NAME@.tar.gz
|
|
16
29
|
|
|
17
30
|
%if 0%{?amzn}
|
|
@@ -50,6 +63,11 @@ Development files for the Couchbase C++ SDK.
|
|
|
50
63
|
-DCOUCHBASE_CXX_CLIENT_STATIC_BORINGSSL=ON \
|
|
51
64
|
-DCOUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF \
|
|
52
65
|
-DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF \
|
|
66
|
+
%if 0%{?amzn} == 0 && (0%{?rhel} >= 9 || 0%{?fedora} > 0 || 0%{?suse_version} > 0)
|
|
67
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY=ON \
|
|
68
|
+
%else
|
|
69
|
+
-DCOUCHBASE_CXX_CLIENT_BUILD_OPENTELEMETRY=OFF \
|
|
70
|
+
%endif
|
|
53
71
|
-DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON \
|
|
54
72
|
-DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=ON \
|
|
55
73
|
-DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON
|
|
@@ -90,3 +90,13 @@ spdlog/*/spdlog/include/*
|
|
|
90
90
|
spdlog/*/spdlog/include/**/*
|
|
91
91
|
spdlog/*/spdlog/src/*
|
|
92
92
|
spdlog/*/spdlog/src/**/*
|
|
93
|
+
opentelemetry/*/opentelemetry/CMakeLists.txt
|
|
94
|
+
opentelemetry/*/opentelemetry/CMakeSettings.json
|
|
95
|
+
opentelemetry/*/opentelemetry/LICENSE
|
|
96
|
+
opentelemetry/*/opentelemetry/*/CMakeLists.txt
|
|
97
|
+
opentelemetry/*/opentelemetry/cmake/*
|
|
98
|
+
opentelemetry/*/opentelemetry/**/CMakeLists.txt
|
|
99
|
+
opentelemetry/*/opentelemetry/**/LICENSE
|
|
100
|
+
opentelemetry/*/opentelemetry/**/*.h
|
|
101
|
+
opentelemetry/*/opentelemetry/**/*.cc
|
|
102
|
+
opentelemetry/*/opentelemetry/third_party/opentelemetry-proto/opentelemetry/proto/**/*.proto
|
|
@@ -83,7 +83,7 @@ public:
|
|
|
83
83
|
static auto dial(app_telemetry_address address,
|
|
84
84
|
cluster_options options,
|
|
85
85
|
asio::io_context& ctx,
|
|
86
|
-
|
|
86
|
+
tls_context_provider& tls,
|
|
87
87
|
std::shared_ptr<connection_state_listener>&& handler)
|
|
88
88
|
-> std::shared_ptr<telemetry_dialer>
|
|
89
89
|
{
|
|
@@ -96,7 +96,7 @@ public:
|
|
|
96
96
|
telemetry_dialer(app_telemetry_address address,
|
|
97
97
|
cluster_options options,
|
|
98
98
|
asio::io_context& ctx,
|
|
99
|
-
|
|
99
|
+
tls_context_provider& tls,
|
|
100
100
|
std::shared_ptr<connection_state_listener>&& handler)
|
|
101
101
|
: address_{ std::move(address) }
|
|
102
102
|
, options_{ std::move(options) }
|
|
@@ -223,7 +223,7 @@ private:
|
|
|
223
223
|
app_telemetry_address address_;
|
|
224
224
|
cluster_options options_;
|
|
225
225
|
asio::io_context& ctx_;
|
|
226
|
-
|
|
226
|
+
tls_context_provider& tls_;
|
|
227
227
|
asio::steady_timer resolve_deadline_;
|
|
228
228
|
asio::steady_timer connect_deadline_;
|
|
229
229
|
asio::ip::tcp::resolver resolver_;
|
|
@@ -426,9 +426,17 @@ public:
|
|
|
426
426
|
private:
|
|
427
427
|
auto build_handshake_message() -> std::vector<std::byte>
|
|
428
428
|
{
|
|
429
|
-
|
|
429
|
+
std::string auth{};
|
|
430
|
+
if (credentials_.uses_jwt()) {
|
|
431
|
+
auth = fmt::format("Bearer {}", credentials_.jwt_token);
|
|
432
|
+
} else {
|
|
433
|
+
auto credentials = fmt::format("{}:{}", credentials_.username, credentials_.password);
|
|
434
|
+
auth = fmt::format(
|
|
435
|
+
"Basic {}",
|
|
436
|
+
base64::encode(gsl::as_bytes(gsl::span{ credentials.data(), credentials.size() })));
|
|
437
|
+
}
|
|
430
438
|
auto message = fmt::format("GET {} HTTP/1.1\r\n"
|
|
431
|
-
"Authorization:
|
|
439
|
+
"Authorization: {}\r\n"
|
|
432
440
|
"Upgrade: websocket\r\n"
|
|
433
441
|
"Connection: Upgrade\r\n"
|
|
434
442
|
"Host: {}:{}\r\n"
|
|
@@ -436,10 +444,7 @@ private:
|
|
|
436
444
|
"Sec-WebSocket-Key: {}\r\n"
|
|
437
445
|
"\r\n",
|
|
438
446
|
address_.path,
|
|
439
|
-
|
|
440
|
-
credentials.data(),
|
|
441
|
-
credentials.size(),
|
|
442
|
-
})),
|
|
447
|
+
auth,
|
|
443
448
|
address_.hostname,
|
|
444
449
|
address_.service,
|
|
445
450
|
codec_.session_key());
|
|
@@ -671,30 +676,29 @@ class app_telemetry_reporter_impl
|
|
|
671
676
|
{
|
|
672
677
|
public:
|
|
673
678
|
app_telemetry_reporter_impl(std::shared_ptr<app_telemetry_meter> meter,
|
|
674
|
-
|
|
675
|
-
cluster_credentials credentials,
|
|
679
|
+
origin& origin,
|
|
676
680
|
asio::io_context& ctx,
|
|
677
|
-
|
|
681
|
+
tls_context_provider& tls)
|
|
678
682
|
: meter_{ std::move(meter) }
|
|
679
|
-
,
|
|
680
|
-
, credentials_{ std::move(credentials) }
|
|
683
|
+
, origin_{ origin }
|
|
681
684
|
, ctx_{ ctx }
|
|
682
685
|
, tls_{ tls }
|
|
683
686
|
, backoff_{ ctx }
|
|
684
687
|
, exponential_backoff_calculator_{
|
|
685
688
|
std::chrono::milliseconds{ 100 },
|
|
686
|
-
|
|
689
|
+
origin_.options().app_telemetry_backoff_interval,
|
|
687
690
|
2 /* backoff factor */,
|
|
688
691
|
0.5 /* jitter factor */,
|
|
689
692
|
}
|
|
690
693
|
{
|
|
691
|
-
if (
|
|
692
|
-
if (!
|
|
693
|
-
auto url =
|
|
694
|
+
if (origin_.options().enable_app_telemetry) {
|
|
695
|
+
if (!origin_.options().app_telemetry_endpoint.empty()) {
|
|
696
|
+
auto url =
|
|
697
|
+
couchbase::core::utils::string_codec::url_parse(origin_.options().app_telemetry_endpoint);
|
|
694
698
|
if (url.host.empty() || url.scheme != "ws") {
|
|
695
699
|
CB_LOG_WARNING(
|
|
696
700
|
"unable to use \"{}\" as a app telemetry endpoint (expected ws:// and hostname)",
|
|
697
|
-
|
|
701
|
+
origin_.options().app_telemetry_endpoint);
|
|
698
702
|
return;
|
|
699
703
|
}
|
|
700
704
|
addresses_.push_back({
|
|
@@ -743,19 +747,19 @@ public:
|
|
|
743
747
|
}
|
|
744
748
|
|
|
745
749
|
websocket_state_ = connection_state::connected;
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
750
|
+
CB_LOG_DEBUG("connected app telemetry endpoint. {}",
|
|
751
|
+
tao::json::to_string(tao::json::value{
|
|
752
|
+
{ "stream", stream->id() },
|
|
753
|
+
{ "hostname", address.hostname },
|
|
754
|
+
}));
|
|
751
755
|
websocket_session_ = websocket_session::start(ctx_,
|
|
752
756
|
address,
|
|
753
|
-
|
|
757
|
+
origin_.credentials(),
|
|
754
758
|
std::move(stream),
|
|
755
759
|
meter_,
|
|
756
760
|
shared_from_this(),
|
|
757
|
-
|
|
758
|
-
|
|
761
|
+
origin_.options().app_telemetry_ping_interval,
|
|
762
|
+
origin_.options().app_telemetry_ping_timeout);
|
|
759
763
|
retry_backoff_calculator_ = &no_backoff_calculator_;
|
|
760
764
|
++next_address_index_;
|
|
761
765
|
}
|
|
@@ -813,25 +817,27 @@ public:
|
|
|
813
817
|
return;
|
|
814
818
|
}
|
|
815
819
|
if (self->websocket_state_ == connection_state::disconnected) {
|
|
816
|
-
self->dialer_ =
|
|
817
|
-
|
|
820
|
+
self->dialer_ = telemetry_dialer::dial(
|
|
821
|
+
next_address, self->origin_.options(), self->ctx_, self->tls_, self);
|
|
818
822
|
}
|
|
819
823
|
});
|
|
820
824
|
return;
|
|
821
825
|
}
|
|
822
|
-
dialer_ =
|
|
826
|
+
dialer_ =
|
|
827
|
+
telemetry_dialer::dial(next_address, origin_.options(), ctx_, tls_, shared_from_this());
|
|
823
828
|
}
|
|
824
829
|
|
|
825
830
|
void update_config(topology::configuration&& config)
|
|
826
831
|
{
|
|
827
|
-
if (!
|
|
832
|
+
if (!origin_.options().enable_app_telemetry) {
|
|
828
833
|
meter_->disable();
|
|
829
834
|
return;
|
|
830
835
|
}
|
|
831
836
|
meter_->update_config(config);
|
|
832
837
|
|
|
833
|
-
if (
|
|
834
|
-
addresses_ = get_app_telemetry_addresses(
|
|
838
|
+
if (origin_.options().app_telemetry_endpoint.empty()) {
|
|
839
|
+
addresses_ = get_app_telemetry_addresses(
|
|
840
|
+
config, origin_.options().enable_tls, origin_.options().network);
|
|
835
841
|
next_address_index_ = 0;
|
|
836
842
|
}
|
|
837
843
|
|
|
@@ -841,17 +847,16 @@ public:
|
|
|
841
847
|
meter_->enable();
|
|
842
848
|
if (websocket_state_ == connection_state::disconnected) {
|
|
843
849
|
dialer_ = telemetry_dialer::dial(
|
|
844
|
-
addresses_[next_address_index_],
|
|
850
|
+
addresses_[next_address_index_], origin_.options(), ctx_, tls_, shared_from_this());
|
|
845
851
|
}
|
|
846
852
|
}
|
|
847
853
|
}
|
|
848
854
|
|
|
849
855
|
private:
|
|
850
856
|
std::shared_ptr<app_telemetry_meter> meter_;
|
|
851
|
-
|
|
852
|
-
cluster_credentials credentials_;
|
|
857
|
+
origin& origin_;
|
|
853
858
|
asio::io_context& ctx_;
|
|
854
|
-
|
|
859
|
+
tls_context_provider& tls_;
|
|
855
860
|
asio::steady_timer backoff_;
|
|
856
861
|
const exponential_backoff_with_jitter exponential_backoff_calculator_;
|
|
857
862
|
|
|
@@ -868,13 +873,10 @@ private:
|
|
|
868
873
|
};
|
|
869
874
|
|
|
870
875
|
app_telemetry_reporter::app_telemetry_reporter(std::shared_ptr<app_telemetry_meter> meter,
|
|
871
|
-
|
|
872
|
-
const cluster_credentials& credentials,
|
|
876
|
+
origin& origin,
|
|
873
877
|
asio::io_context& ctx,
|
|
874
|
-
|
|
875
|
-
: impl_{
|
|
876
|
-
std::make_shared<app_telemetry_reporter_impl>(std::move(meter), options, credentials, ctx, tls)
|
|
877
|
-
}
|
|
878
|
+
tls_context_provider& tls)
|
|
879
|
+
: impl_{ std::make_shared<app_telemetry_reporter_impl>(std::move(meter), origin, ctx, tls) }
|
|
878
880
|
{
|
|
879
881
|
}
|
|
880
882
|
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
|
|
16
16
|
#pragma once
|
|
17
17
|
|
|
18
|
+
#include "cluster.hxx"
|
|
18
19
|
#include "config_listener.hxx"
|
|
20
|
+
#include "tls_context_provider.hxx"
|
|
19
21
|
|
|
20
22
|
#include <memory>
|
|
21
23
|
|
|
@@ -45,10 +47,9 @@ public:
|
|
|
45
47
|
auto operator=(const app_telemetry_reporter&) -> app_telemetry_reporter& = delete;
|
|
46
48
|
|
|
47
49
|
app_telemetry_reporter(std::shared_ptr<app_telemetry_meter> meter,
|
|
48
|
-
|
|
49
|
-
const cluster_credentials& credentials,
|
|
50
|
+
origin& origin,
|
|
50
51
|
asio::io_context& ctx,
|
|
51
|
-
|
|
52
|
+
tls_context_provider& tls);
|
|
52
53
|
~app_telemetry_reporter() override;
|
|
53
54
|
void update_config(topology::configuration config) override;
|
|
54
55
|
void stop();
|