-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parts of the gRPC istrumentation (#1330)
* feat(grpc): write the client tracing instrumentation in the interceptor manner * feat(grpc): migrate from rspec to minitest * feat(grpc): introduce Appraisals * fix(grpc): remove active_support dependency * Update grpc.rb * Update README.md * ci: add (probably) missing grpc gem in the ci-instrumentation * cI: grpc is not included in the all gem yet * ci: skip grpc from the CI for now * a better approach towards client testing * add an unversioned Appraisal Co-authored-by: Kayla Reopelle <[email protected]> * Update instrumentation/grpc/README.md Co-authored-by: Kayla Reopelle <[email protected]> * Update instrumentation/grpc/lib/opentelemetry/instrumentation/grpc/patches/client_stub.rb Co-authored-by: Kayla Reopelle <[email protected]> * Update instrumentation/grpc/test/test_helper.rb Co-authored-by: Kayla Reopelle <[email protected]> * add opentelemetry-test-helpers and rake as development dependencies --------- Co-authored-by: Kayla Reopelle <[email protected]>
- Loading branch information
1 parent
190aa9d
commit e3c020f
Showing
28 changed files
with
297 additions
and
320 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,13 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
appraise 'grpc-1.68' do | ||
gem 'grpc', '~> 1.68.0' | ||
end | ||
|
||
appraise 'grpc-latest' do | ||
gem 'grpc' | ||
end |
This file contains 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 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 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 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 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 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
27 changes: 27 additions & 0 deletions
27
instrumentation/grpc/lib/opentelemetry/instrumentation/grpc/patches/client_stub.rb
This file contains 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,27 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
module OpenTelemetry | ||
module Instrumentation | ||
module Grpc | ||
module Patches | ||
# Module to be prepended to force gRPC to use the client interceptor by | ||
# default so the user doesn't have to manually add it when initializing a client. | ||
module ClientStub | ||
def initialize(host, creds, **args) | ||
interceptors = args[:interceptors] || [] | ||
interceptors.unshift(Interceptors::ClientTracer.new) unless interceptors.any? do |interceptor| | ||
interceptor.is_a?(Interceptors::ClientTracer) | ||
end | ||
args[:interceptors] = interceptors | ||
|
||
super | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
instrumentation/grpc/spec/example/controllers/example_api_controller.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
instrumentation/grpc/spec/example/proto/example_api_services_pb.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.