open-telemetry / open-telemetry/opentelemetry-python-contrib

Grpc channel API breaks when using grpc client instrumentor

Open
#1,697 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted instrumentation
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment
I'm using GrpcInstrumentorClient (https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/grpc/grpc.html#usage-client) version 0.30b1 in a python (3.7) flask application. When closing the channel, using a custom wrapper around channel, calls to the grpc.Channel._channel API fail.

Steps to reproduce

  1. Instrument with GrpcInstrumentorClient().instrument()
  2. In a grpc middleware, or anywhere with access to the grpc channel object, call a method on channel._channel, like channel._channel.check_connectivity_state()

What is the expected behavior?
the grpc channel._channel is an instance of grpc._cython.cygrpc.Channel

What is the actual behavior?
the grpc channel._channel is an instance of grpc._channel.Channel

Additional context
GRPCInstrumentorClient works fine with no middleware or other interceptors present.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the GrpcInstrumentorClient instrumentation and its channel wrapper, reproducing the failure with Python 3.7, Flask, grpc version 0.30b1, and a call to channel._channel.check_connectivity_state(). Done means instrumented channels retain the expected grpc._cython.cygrpc.Channel API while middleware or other interceptors are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.