Skip to content

Commit 8ba7ca3

Browse files
committed
chore: Markdown lint, class updates for CI
1 parent 59b313e commit 8ba7ca3

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

instrumentation/grpc/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ OpenTelemetry instrumentation for users of the `grpc` gem
88
> [!WARNING]
99
> Right now, the gem only instruments outbound requests to gRPC services
1010
11+
> [!WARNING]
12+
> This gem is not ready for release by the open-telemetry org yet, but other versions are available on RubyGems
13+
1114
## Installation
1215

1316
Install the gem and add to the application's Gemfile by executing:
1417

15-
$ bundle add opentelemetry-instrumentation-grpc
18+
```sh
19+
$ bundle add opentelemetry-instrumentation-grpc
20+
```
1621

1722
If bundler is not being used to manage dependencies, install the gem by executing:
1823

19-
$ gem install opentelemetry-instrumentation-grpc
24+
```sh
25+
$ gem install opentelemetry-instrumentation-grpc
26+
```
2027

2128
## Usage
2229

instrumentation/grpc/lib/opentelemetry/instrumentation/grpc/instrumentation.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Grpc
1111
class Instrumentation < OpenTelemetry::Instrumentation::Base
1212
install do |_config|
1313
require_dependencies
14+
patch
1415
end
1516

1617
option :allowed_metadata_headers, default: [], validate: :array
@@ -22,6 +23,10 @@ class Instrumentation < OpenTelemetry::Instrumentation::Base
2223

2324
private
2425

26+
def patch
27+
::GRPC::ClientInterceptor.prepend(Interceptors::Client)
28+
end
29+
2530
def require_dependencies
2631
require_relative "interceptors/client"
2732
end

instrumentation/grpc/lib/opentelemetry/instrumentation/grpc/interceptors/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module OpenTelemetry
88
module Instrumentation
99
module Grpc
1010
module Interceptors
11-
class Client < ::GRPC::ClientInterceptor
11+
class Client
1212
def request_response(request: nil, call: nil, method: nil, metadata: nil, &blk)
1313
call(type: "request_response", requests: [request], call: call, method: method, metadata: metadata, &blk)
1414
end

0 commit comments

Comments
 (0)