Skip to content

Public API to access the channel target of a gRPC request #38519

@ohmayr

Description

@ohmayr

Python pubsub wants to obtain the channel target for a gRPC request. They're currently doing it the following way:

channel = client.transport.publish._channel
channel.target().decode("utf8")

However, this broke when the underlying GAPIC implementation was updated to use an intercept channel. To summarize, the underlying type changed from _channel._UnaryUnaryMultiCallable to _interceptor._UnaryUnaryMultiCallable. The new type does not have the private property _channel directly exposed which breaks their code.

We've proposed the following workaround for now to unblock their release:

channel = client.transport.publish._thunk("")._channel
channel.target().decode("utf8")

Given that the solution above still uses a private API and can easily break, we're looking for a public API to get the channel target.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions