-
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
Open
DemetrisChr
wants to merge
9
commits into
couchbase:main
Choose a base branch
from
DemetrisChr:RCBC-524-otel-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bb24ec2
RCBC-524: OpenTelemetry integration
DemetrisChr fd7b831
fix: improve regex pattern precision in CI workflow
avsej 570bfe3
fix(rcb_query.cxx): add missing bucket_name to error message
avsej 4e89bf1
Add Rakefile, README, API docs, change namespace of Otel tracer/meter
DemetrisChr 6887e5f
GHA: Include couchbase-opentelemetry in uploaded artifacts
DemetrisChr 4b7b2a2
GHA: Install couchbase-opentelemetry gem for tests
DemetrisChr 3a44e02
Otel test: Add check for cluster label support
DemetrisChr f3cb3ee
Fix alpine build
DemetrisChr c5d92e7
Fix typos
DemetrisChr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| --no-progress --output-dir doc/couchbase-ruby-client-master lib - README.md | ||
| --tag couchbase.stability:"Stability" | ||
| --transitive-tag couchbase.stability | ||
| --hide-api private |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| inherit_from: ../.rubocop.yml |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --no-progress --output-dir doc/couchbase-ruby-client-master lib - README.md | ||
| --tag couchbase.stability:"Stability" | ||
| --transitive-tag couchbase.stability | ||
| --hide-api private |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Couchbase Ruby Client OpenTelemetry Integration | ||
|
|
||
| ## Installation | ||
|
|
||
| The library has been tested with MRI 3.2, 3.3, 3.4 and 4.0. Supported platforms are Linux and MacOS. | ||
|
|
||
| Add this line to your application's Gemfile: | ||
|
|
||
| ```ruby | ||
| gem "couchbase-opentelemetry", "0.1.0" | ||
| ``` | ||
|
|
||
| And then execute: | ||
|
|
||
| $ bundle install | ||
|
|
||
| Or install it yourself as: | ||
|
|
||
| $ gem install couchbase-opentelemetry | ||
|
|
||
| ## Usage | ||
|
|
||
| Here is an example on how to set up Tracing and Metrics with OpenTelemetry: | ||
|
|
||
| ```ruby | ||
| require "couchbase" | ||
| require "couchbase/opentelemetry" | ||
|
|
||
| require "opentelemetry-sdk" | ||
| require "opentelemetry-metrics-sdk" | ||
|
|
||
| # Initialize a tracer provider | ||
| tracer_provider = OpenTelemetry::SDK::Trace::TracerProvider.new | ||
| tracer_provider.add_span_processor( | ||
| OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new( | ||
| OpenTelemetry::Exporter::OTLP::Exporter.new(endpoint: "https://<hostname>:<port>/v1/traces") | ||
| ) | ||
| ) | ||
|
|
||
| # Initialize the Couchbase OpenTelemetry Request Tracer | ||
| tracer = Couchbase::OpenTelemetry::RequestTracer.new(tracer_provider) | ||
|
|
||
| # Initialize a meter provider | ||
| meter_provider = OpenTelemetry::SDK::Metrics::MeterProvider.new | ||
| meter_provider.add_metric_reader( | ||
| OpenTelemetry::SDK::Metrics::Export::PeriodicMetricReader.new( | ||
| exporter: OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter.new( | ||
| endpoint: "https://<hostname>:<port>/v1/metrics" | ||
| ) | ||
| ) | ||
| ) | ||
|
|
||
| # Initialize the Couchbase OpenTelemetry Meter | ||
| meter = Couchbase::OpenTelemetry::Meter.new(meter_provider) | ||
|
|
||
| # Configure tracer and meter in cluster options | ||
| options = Couchbase::Options::Cluster.new( | ||
| authenticator: Couchbase::PasswordAuthenticator.new("Administrator", "password") | ||
| tracer: tracer, | ||
| meter: meter | ||
| ) | ||
|
|
||
| # Initialize cluster instance | ||
| cluster = Cluster.connect("couchbase://127.0.0.1", options) | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| The gem is available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0). | ||
|
|
||
| Copyright 2025-Present Couchbase, Inc. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.