Skip to content

Conversation

@DemetrisChr
Copy link
Contributor

@DemetrisChr DemetrisChr commented Dec 16, 2025

Motivation

As part of the observability work, we need to add support for collecting metrics, following the Extended Observability RFC.

Changes

  • Add Meter and ValueRecorder abstract base classes
  • Extend the observability wrapper to report metrics for every operation, at the same level as the top-level operation span.
  • Add Ruby bindings for the HDR Histogram implementation used by the C++ core.
  • Add a default LoggingMeter implementation. This utilizes the HDR Histogram Ruby bindings.
  • Disable metrics in the C++ core, as metric collection now happens entirely on the Ruby side.

@DemetrisChr DemetrisChr force-pushed the RCBC-526-metrics branch 2 times, most recently from c1a57bf to e2df93b Compare December 17, 2025 16:34
@DemetrisChr DemetrisChr marked this pull request as ready for review December 17, 2025 18:01
@DemetrisChr DemetrisChr marked this pull request as draft January 6, 2026 17:07
@DemetrisChr DemetrisChr force-pushed the RCBC-526-metrics branch 2 times, most recently from 565ea8b to 98d5d52 Compare January 6, 2026 17:18
@DemetrisChr DemetrisChr requested a review from Copilot January 6, 2026 17:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for metrics collection in the Couchbase Ruby SDK. The implementation introduces a meter abstraction with logging and noop implementations, along with test utilities for metrics verification.

Key changes:

  • Added metrics infrastructure with Meter and ValueRecorder interfaces
  • Integrated metrics collection into the observability layer to track operation durations
  • Added HDR histogram implementation for efficient percentile calculations

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/couchbase/metrics/*.rb Core metrics interfaces (Meter, ValueRecorder) and implementations (NoopMeter, LoggingMeter)
lib/couchbase/utils/observability.rb Integrated metrics collection into operation tracking with error handling
lib/couchbase/options.rb Added meter configuration option to Cluster options
lib/couchbase/cluster.rb Wired up meter initialization with LoggingMeter as default
lib/couchbase/utils/hdr_histogram.rb Ruby wrapper for HDR histogram percentile calculations
ext/rcb_hdr_histogram.* C++ extension for HDR histogram functionality
test/utils/metrics/*.rb Test utilities for metrics verification
test/*_test.rb Integration tests for metrics collection
ext/rcb_backend.cxx Disabled core-level metrics in favor of wrapper-side handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DemetrisChr DemetrisChr marked this pull request as ready for review January 6, 2026 17:34
@DemetrisChr DemetrisChr requested a review from avsej January 6, 2026 17:34
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants