RCBC-524: OpenTelemetry integration#216
Merged
DemetrisChr merged 9 commits intocouchbase:mainfrom Feb 2, 2026
Merged
Conversation
avsej
reviewed
Jan 22, 2026
589f3f7 to
ac2f4fe
Compare
Update the gemspec replacement pattern from `/gemspec/` to `/gemspec$/` to ensure it only matches "gemspec" at the end of lines. This prevents potential partial matches that could cause incorrect Gemfile modifications during the test gem installation process. The $ anchor makes the regex more precise and robust for the automated gem unpacking and bundling workflow.
The bucket_name parameter was missing from the fmt::format call in cb_Backend_query_index_build_deferred, causing the error message to not include the bucket name when reporting deferred index build failures. Which in turn caused build failure with recent GCC, where fmtlib tries to validate format strings compile-time.
48cef92 to
3a44e02
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds OpenTelemetry integration for the Couchbase Ruby client to enhance observability capabilities. It introduces a new couchbase-opentelemetry gem that provides OpenTelemetryRequestTracer and OpenTelemetryMeter implementations for easy integration with OpenTelemetry's tracing and metrics APIs.
Changes:
- Added new
couchbase-opentelemetrygem with OpenTelemetry tracer and meter implementations - Enhanced request spans with status tracking (
:ok,:error,:unset) - Added comprehensive test coverage using OpenTelemetry's in-memory exporters
- Updated CI/CD workflows to build, test, and publish the new gem
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| couchbase-opentelemetry/lib/couchbase/opentelemetry/request_tracer.rb | Implements OpenTelemetry request tracer wrapper |
| couchbase-opentelemetry/lib/couchbase/opentelemetry/meter.rb | Implements OpenTelemetry meter wrapper with histogram support |
| couchbase-opentelemetry/lib/couchbase/opentelemetry/request_span.rb | Wraps OpenTelemetry spans with status code mapping |
| couchbase-opentelemetry/lib/couchbase/opentelemetry/value_recorder.rb | Handles metric value recording with unit conversion |
| lib/couchbase/tracing/request_span.rb | Adds status setter to base request span interface |
| lib/couchbase/utils/observability.rb | Adds success/error status tracking to spans |
| lib/couchbase/errors.rb | Adds TracerError and MeterError exception classes |
| test/opentelemetry_test.rb | Tests OpenTelemetry integration with in-memory exporters |
| .github/workflows/tests.yml | Updates CI to build and test the new gem |
| couchbase-opentelemetry/README.md | Provides usage documentation and examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
couchbase-opentelemetry/lib/couchbase/opentelemetry/request_tracer.rb
Outdated
Show resolved
Hide resolved
avsej
approved these changes
Jan 30, 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
As part of the observability work, we should add Meter and Tracer implementations that allow easy integration with OpenTelemetry.
Changes
OpenTelemetryRequestTracerandOpenTelemetryMeter. Both will be shipped as part of thecouchbase-opentelemetrygemstatuson request tracers.TracerErrorandMeterErrorthat wrap any errors coming from the wrapped Otel tracer/meter.