RCBC-536: Add cluster name and cluster uuid span/metric attributes #202
Merged
DemetrisChr merged 1 commit intocouchbase:mainfrom Jan 16, 2026
Merged
RCBC-536: Add cluster name and cluster uuid span/metric attributes #202DemetrisChr merged 1 commit intocouchbase:mainfrom
DemetrisChr merged 1 commit intocouchbase:mainfrom
Conversation
9a501d8 to
027ed35
Compare
There was a problem hiding this comment.
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
envparameter 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.
027ed35 to
3b09513
Compare
avsej
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The Observability RFC requires all spans and metrics to include the
couchbase.cluster.nameandcouchbase.cluster.uuidattributesChanges
Add the
couchbase.cluster.uuidandcouchbase.cluster.nameattributes 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.