Skip to content

Conversation

@DemetrisChr
Copy link
Contributor

Motivation

As part of the observability work, we should add Meter and Tracer implementations that allow easy integration with OpenTelemetry.

Changes

  • Add OpenTelemetryRequestTracer and OpenTelemetryMeter. Both will be shipped as part of the couchbase-opentelemetry gem
  • Add tests using OpenTelemetry's in-memory exporters
  • Add status on request tracers.
  • Add TracerError and MeterError that wrap any errors coming from the wrapped Otel tracer/meter.

@DemetrisChr DemetrisChr force-pushed the RCBC-524-otel-integration branch 5 times, most recently from 589f3f7 to ac2f4fe Compare January 27, 2026 15:58
DemetrisChr and others added 7 commits January 27, 2026 16:40
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.
@DemetrisChr DemetrisChr force-pushed the RCBC-524-otel-integration branch from 48cef92 to 3a44e02 Compare January 27, 2026 16:42
@DemetrisChr DemetrisChr requested review from avsej and Copilot January 27, 2026 19:55
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 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-opentelemetry gem 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.

Co-authored-by: Copilot <[email protected]>
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.

2 participants