opentelemetry-erlang-contrib/instrumentation/opentelemetry_grpcbox
Bryan Naegele 8407ad98bd
Update to opentelemetry_api 1.2 (#232)
Co-authored-by: Tristan Sloughter <t@crashfast.com>
2023-12-01 13:48:32 -07:00
..
src Update to opentelemetry_api 1.2 (#232) 2023-12-01 13:48:32 -07:00
test add grpcbox instrumentation library (#70) 2022-03-27 11:42:36 -06:00
.gitignore add grpcbox instrumentation library (#70) 2022-03-27 11:42:36 -06:00
LICENSE add grpcbox instrumentation library (#70) 2022-03-27 11:42:36 -06:00
README.md add grpcbox instrumentation library (#70) 2022-03-27 11:42:36 -06:00
rebar.config Update to opentelemetry_api 1.2 (#232) 2023-12-01 13:48:32 -07:00
rebar.lock Update to opentelemetry_api 1.2 (#232) 2023-12-01 13:48:32 -07:00

README.md

opentelemetry_grpcbox

This grpcbox interceptor uses the OpenTelemetry API to create Spans for outgoing and incoming requests and propagates them as part of the gRPC metadata.

Server

Configure as an interceptor:

#{service_protos => [route_guide_pb],
  unary_interceptor => {otel_grpcbox_interceptor, unary}}

Or as a middleware in the chain interceptor:

#{service_protos => [route_guide_pb],
  unary_interceptor =>
    grpcbox_chain_interceptor:unary([..., 
                                     fun otel_grpcbox_interceptor:unary/4, 
                                     ...])}

Client

Example in sys.config for setting up a client channel:

{client, #{channels => [{default_channel, [{http, "localhost", 8080, []}], 
                        #{unary_interceptor => fun otel_grpcbox_interceptor:unary_client/7}}]}}