-
Notifications
You must be signed in to change notification settings - Fork 55
RCBC-524: OpenTelemetry integration #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
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-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
Co-authored-by: Copilot <[email protected]>
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.