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():
149
149
grpc_client_instrumentor.instrument()
150
150
151
151
async def run():
152
- with grpc.aio.insecure_channel("localhost:50051") as channel:
152
+ async with grpc.aio.insecure_channel("localhost:50051") as channel:
153
153
154
154
stub = helloworld_pb2_grpc.GreeterStub(channel)
155
155
response = await stub.SayHello(helloworld_pb2.HelloRequest(name="YOU"))
@@ -168,7 +168,7 @@ async def run():
168
168
169
169
from opentelemetry.instrumentation.grpc import aio_client_interceptors
170
170
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:
172
172
173
173
174
174
Usage Aio Server
@@ -253,6 +253,11 @@ async def serve():
253
253
254
254
.. code-block::
255
255
256
+ import grpc
257
+ from concurrent import futures
258
+ from opentelemetry.instrumentation.grpc import filters
259
+ from opentelemetry.instrumentation.grpc import server_interceptor
260
+
256
261
my_interceptor = server_interceptor(
257
262
filter_ = filters.negate(filters.method_name("TestMethod"))
258
263
)
You can’t perform that action at this time.
0 commit comments