File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
instrumentation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def serve():
149149 grpc_client_instrumentor.instrument()
150150
151151 async def run():
152- with grpc.aio.insecure_channel("localhost:50051") as channel:
152+ async with grpc.aio.insecure_channel("localhost:50051") as channel:
153153
154154 stub = helloworld_pb2_grpc.GreeterStub(channel)
155155 response = await stub.SayHello(helloworld_pb2.HelloRequest(name="YOU"))
@@ -168,7 +168,7 @@ async def run():
168168
169169 from opentelemetry.instrumentation.grpc import aio_client_interceptors
170170
171- channel = grpc.aio.insecure_channel("localhost:12345 ", interceptors=aio_client_interceptors())
171+ async with grpc.aio.insecure_channel("localhost:50051 ", interceptors=aio_client_interceptors()) as channel:
172172
173173
174174Usage Aio Server
@@ -253,6 +253,11 @@ async def serve():
253253
254254.. code-block::
255255
256+ import grpc
257+ from concurrent import futures
258+ from opentelemetry.instrumentation.grpc import filters
259+ from opentelemetry.instrumentation.grpc import server_interceptor
260+
256261 my_interceptor = server_interceptor(
257262 filter_ = filters.negate(filters.method_name("TestMethod"))
258263 )
You can’t perform that action at this time.
0 commit comments