Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def serve():
grpc_client_instrumentor.instrument()

async def run():
with grpc.aio.insecure_channel("localhost:50051") as channel:
async with grpc.aio.insecure_channel("localhost:50051") as channel:

stub = helloworld_pb2_grpc.GreeterStub(channel)
response = await stub.SayHello(helloworld_pb2.HelloRequest(name="YOU"))
Expand All @@ -168,7 +168,7 @@ async def run():

from opentelemetry.instrumentation.grpc import aio_client_interceptors

channel = grpc.aio.insecure_channel("localhost:12345", interceptors=aio_client_interceptors())
async with grpc.aio.insecure_channel("localhost:50051", interceptors=aio_client_interceptors()) as channel:


Usage Aio Server
Expand Down Expand Up @@ -253,6 +253,11 @@ async def serve():

.. code-block::

import grpc
from concurrent import futures
from opentelemetry.instrumentation.grpc import filters
from opentelemetry.instrumentation.grpc import server_interceptor

my_interceptor = server_interceptor(
filter_ = filters.negate(filters.method_name("TestMethod"))
)
Expand Down