Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ set(couchbase_cxx_client_FILES
core/impl/view_error_category.cxx
core/impl/wildcard_query.cxx
core/impl/crypto.cxx
core/impl/observability_recorder.cxx
core/io/config_tracker.cxx
core/io/dns_client.cxx
core/io/dns_config.cxx
Expand Down
2 changes: 2 additions & 0 deletions core/bucket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ class bucket_impl
std::optional<key_value_error_map_info> error_info)
{
// TODO(SA): copy from mcbp_command, subject to refactor later
#ifdef COUCHBASE_CXX_CLIENT_CREATE_OPERATION_SPAN_IN_CORE
metrics::metric_attributes attrs{
service_type::key_value, fmt::format("{}", req->command_), ec, name_, req->scope_name_,
req->collection_name_,
};
meter_->record_value(std::move(attrs), req->dispatched_time_);
#endif

if (ec == asio::error::operation_aborted) {
// TODO(SA): fix tracing
Expand Down
11 changes: 11 additions & 0 deletions core/cluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,11 @@ class cluster_impl : public std::enable_shared_from_this<cluster_impl>
return tracer_;
}

auto meter() const -> const std::shared_ptr<metrics::meter_wrapper>&
{
return meter_;
}

private:
void setup_observability()
{
Expand Down Expand Up @@ -2474,4 +2479,10 @@ cluster::tracer() const -> const std::shared_ptr<tracing::tracer_wrapper>&
return impl_->tracer();
}

auto
cluster::meter() const -> const std::shared_ptr<metrics::meter_wrapper>&
{
return impl_->meter();
}

} // namespace couchbase::core
6 changes: 6 additions & 0 deletions core/cluster.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ namespace tracing
class tracer_wrapper;
} // namespace tracing

namespace metrics
{
class meter_wrapper;
} // namespace metrics

namespace mcbp
{
class queue_request;
Expand Down Expand Up @@ -331,6 +336,7 @@ public:
[[nodiscard]] auto to_string() const -> std::string;

[[nodiscard]] auto tracer() const -> const std::shared_ptr<tracing::tracer_wrapper>&;
[[nodiscard]] auto meter() const -> const std::shared_ptr<metrics::meter_wrapper>&;

private:
std::shared_ptr<cluster_impl> impl_;
Expand Down
Loading
Loading