gapic-generator-java icon indicating copy to clipboard operation
gapic-generator-java copied to clipboard

Add toString for InstantiatingGrpcChannelProvider

Open igorbernstein2 opened this issue 1 year ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. When debugging customer issues it is very useful to get a copy of the settings that they are using. Unfortunately since InstantiatingGrpcChannelProvider doesnt implement toString, the settings are hidden from view:

BigtableDataSettings{
    // ...
    stubSettings=EnhancedBigtableStubSettings{
    //....
transportChannelProvider=com.google.api.gax.grpc.InstantiatingGrpcChannelProvider@213ceb4e,
        credentialsProvider=GoogleCredentialsProvider{
          scopesToApply=[
            https://www.googleapis.com/auth/bigtable.data,
            https://www.googleapis.com/auth/bigtable.data.readonly,
            https://www.googleapis.com/auth/cloud-bigtable.data,
            https://www.googleapis.com/auth/cloud-bigtable.data.readonly,
            https://www.googleapis.com/auth/cloud-platform,
            https://www.googleapis.com/auth/cloud-platform.read-only
          ],
          jwtEnabledScopes=[
            https://www.googleapis.com/auth/bigtable.data,
            https://www.googleapis.com/auth/cloud-bigtable.data,
            https://www.googleapis.com/auth/cloud-platform
          ],
          useJwtAccessWithScope=true,
          OAuth2Credentials=null
        },
        headerProvider=com.google.api.gax.rpc.NoHeaderProvider@23c72128,
        internalHeaderProvider=FixedHeaderProvider{
          headers={
            x-goog-api-client=gl-java/17.0.6__Amazon.com-Inc.__Corretto-17.0.6.10.1 gapic/2.31.0 gax/2.39.0 grpc/1.60.0,
            user-agent=bigtable-java/2.31.0,
            bigtable-features=CAEgATABOAE=
          }
        },
....

Describe the solution you'd like I would like InstantiatingGrpcChannelProvider to override toString and export its internal config (similar to GoogleCredentialsProvider)

Describe alternatives you've considered I dont think there are any alternatives than to implement this

Additional context Any other context or screenshots about the feature request.

igorbernstein2 avatar Jan 25 '24 16:01 igorbernstein2

I think this request makes sense, the reason InstantiatingGrpcChannelProvider does not override toString like others is that it is not an AutoValue class. In addition, if we want to print all the info recursively, we need to override toString method for all the fields in InstantiatingGrpcChannelProvider.

@igorbernstein2 What are the fields you care most? Are you OK with us limiting the scope to exclude overriding toString for all the fields(e.g. MtlsProvider)?

blakeli0 avatar Jan 25 '24 21:01 blakeli0