Skip to content

Allow adding a grpc.service_config without having to specify each service name. #2549

Closed
@martyphee

Description

@martyphee

Is your feature request related to a problem? Please describe.

When specifying grpc.service_config we have to specify each service in the name configuration or an error is thrown.

Example

"grpc.service_config": JSON.stringify({
    methodConfig: [
      {
        name: [{ service: "org.grpc.service.v1.PolicyManagementService" }],
        timeout: {
          seconds: 5,
          nanos: 0
        }
      }
    ]
  })

Describe the solution you'd like

Could we make the name optional like [{}]? We do this in our Python and Scala services and it works as expected.

Describe alternatives you've considered

An alternative might be a wildcard like org.grpc.*

Additional context

Might just be the project I'm using this on but it needs to interact with a number of services and I would need to list them all. It's not a huge deal but it would be nice if it worked like other gRPC libraries.

Here is a sample from on of our Python applications which is in production.

import json

import grpc
from grpc.aio import insecure_channel, secure_channel

from app.configuration import configuration

OPTIONS = [
    ("grpc.enable_retries", 1),
    (
        "grpc.service_config",
        json.dumps(
            {
                "methodConfig": [
                    {
                        "name": [{}],
                        "retryPolicy": {
                            "maxAttempts": 5,
                            "initialBackoff": "0.1s",
                            "maxBackoff": "1s",
                            "backoffMultiplier": 2,
                            "retryableStatusCodes": ["UNAVAILABLE"],
                        },
                    }
                ]
            },
        ),
    ),
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions