Skip to content

Conversation

@DemetrisChr
Copy link
Contributor

@DemetrisChr DemetrisChr commented Jan 6, 2026

Motivation

The Observability RFC requires all spans and metrics to include the couchbase.cluster.name and couchbase.cluster.uuid attributes

Changes

Add the couchbase.cluster.uuid and couchbase.cluster.name attributes to all spans and metrics created by the Ruby SDK. The value of these attributes is accessed by the C++ core. They are present if the server version supports them.

@CLAassistant
Copy link

CLAassistant commented Jan 8, 2026

CLA assistant check
All committers have signed the CLA.

@DemetrisChr DemetrisChr force-pushed the cluster-labels branch 2 times, most recently from 9a501d8 to 027ed35 Compare January 12, 2026 12:48
@DemetrisChr DemetrisChr marked this pull request as ready for review January 12, 2026 12:49
@DemetrisChr DemetrisChr requested review from avsej and Copilot January 12, 2026 12:51
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 implements support for cluster name and cluster UUID attributes in observability (spans and metrics) as required by the Observability RFC. These attributes are conditionally added based on server version support (7.6.4+) and retrieved from the C++ core backend.

Changes:

  • Added supports_cluster_labels? version check for server 7.6.4+
  • Modified observability handlers to include cluster name/UUID attributes in spans and metrics
  • Updated test helper functions to accept env parameter for cluster label validation
  • Implemented C++ backend method to retrieve cluster labels from core API

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_helper.rb Added cluster label support check and methods to fetch cluster name/UUID from server
lib/couchbase/utils/observability.rb Modified to accept backend and add cluster labels to spans and metrics
lib/couchbase/cluster.rb Reordered initialization to pass backend to observability wrapper
ext/rcb_observability.cxx Implemented C++ method to retrieve cluster labels from core cluster
ext/rcb_observability.hxx Added function declaration for observability initialization
ext/couchbase.cxx Added observability initialization call
test/utils/tracing.rb Updated assertion functions to accept env and validate cluster labels
test/utils/metrics.rb Updated metric assertion to include cluster label validation
test/tracing_test.rb Updated test calls to pass env parameter
test/query_index_manager_test.rb Updated test calls to pass env parameter
test/metrics_test.rb Updated test calls to pass env parameter

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

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