Skip to content

What is the format of the xDS debug responses? #31997

@esnible

Description

@esnible

Queries for discovery.DiscoveryRequest{TypeUrl: "istio.io/debug", ...} get responses that cannot be deserialized with jsonpb.

For example, discovery.DiscoveryRequest{TypeUrl: "istio.io/debug", ResourceNames: ["mesh"]} yields a response where the resources are [{"type_url":"istio.io/debug","value":"ewogICJwcm94eUxpc3RlblBvcnQiOiAxNTAwMSwKICAiY29ubmVjdFRpbWVvdXQiOiAiMTBzIiwKICAicHJvdG9jb2xEZXRlY3Rpb25UaW1lb3V0IjogIjBzIiwKICAiaW5ncmVzc0NsYXNzIjogImlzdGlvIiwKICAiaW5ncmVzc1NlcnZpY2UiOiAiaXN0aW8taW5ncmVzc2dhdGV3YXkiLAogICJpbmdyZXNzQ29udHJvbGxlck1vZGUiOiAiU1RSSUNUIiwKICAiZW5hYmxlVHJhY2luZyI6IHRydWUsCiAgImFjY2Vzc0xvZ0ZpbGUiOiAiL2Rldi9zdGRvdXQiLAogICJkZWZhdWx0Q29uZmlnIjogewogICAgImNvbmZpZ1BhdGgiOiAiLi9ldGMvaXN0aW8vcHJveHkiLAogICAgImJpbmFyeVBhdGgiOiAiL3Vzci9sb2NhbC9iaW4vZW52b3kiLAogICAgInNlcnZpY2VDbHVzdGVyIjogImlzdGlvLXByb3h5IiwKICAgICJkcmFpbkR1cmF0aW9uIjogIjQ1cyIsCiAgICAicGFyZW50U2h1dGRvd25EdXJhdGlvbiI6ICI2MHMiLAogICAgImRpc2NvdmVyeUFkZHJlc3MiOiAiaXN0aW9kLmlzdGlvLXN5c3RlbS5zdmM6MTUwMTIiLAogICAgInByb3h5QWRtaW5Qb3J0IjogMTUwMDAsCiAgICAiY29udHJvbFBsYW5lQXV0aFBvbGljeSI6ICJNVVRVQUxfVExTIiwKICAgICJzdGF0TmFtZUxlbmd0aCI6IDE4OSwKICAgICJjb25jdXJyZW5jeSI6IDIsCiAgICAidHJhY2luZyI6IHsKICAgICAgInppcGtpbiI6IHsKICAgICAgICAiYWRkcmVzcyI6ICJ6aXBraW4uaXN0aW8tc3lzdGVtOjk0MTEiCiAgICAgIH0KICAgIH0sCiAgICAic3RhdHVzUG9ydCI6IDE1MDIwLAogICAgInRlcm1pbmF0aW9uRHJhaW5EdXJhdGlvbiI6ICI1cyIKICB9LAogICJvdXRib3VuZFRyYWZmaWNQb2xpY3kiOiB7CiAgICAibW9kZSI6ICJBTExPV19BTlkiCiAgfSwKICAiZW5hYmxlQXV0b010bHMiOiB0cnVlLAogICJ0cnVzdERvbWFpbiI6ICJjbHVzdGVyLmxvY2FsIiwKICAiZGVmYXVsdFNlcnZpY2VFeHBvcnRUbyI6IFsKICAgICIqIgogIF0sCiAgImRlZmF1bHRWaXJ0dWFsU2VydmljZUV4cG9ydFRvIjogWwogICAgIioiCiAgXSwKICAiZGVmYXVsdERlc3RpbmF0aW9uUnVsZUV4cG9ydFRvIjogWwogICAgIioiCiAgXSwKICAicm9vdE5hbWVzcGFjZSI6ICJpc3Rpby1zeXN0ZW0iLAogICJsb2NhbGl0eUxiU2V0dGluZyI6IHsKICAgICJlbmFibGVkIjogdHJ1ZQogIH0sCiAgImRuc1JlZnJlc2hSYXRlIjogIjVzIiwKICAidGhyaWZ0Q29uZmlnIjogewoKICB9LAogICJlbmFibGVQcm9tZXRoZXVzTWVyZ2UiOiB0cnVlCn0="}].

(If you run the value through base64 -D you will see it is a base64 encoding of a serialized JSON MeshConfig)

I think it would be better if the typeURL and value followed the other xDS responses. The typeURL should be something like
type.googleapis.com/istio.mesh.v1alpha1.MeshConfig and the value should be a protobuf, not a string.

(It might also make sense for the typeURL to be something like "type.googleapis.com/google.protobuf.StringValue", and the value to be a string.)

cc @irisdingbj @therealmitchconnors @howardjohn

My preference would be that the top-level request include the type. I believe for example the gRPC client should send a discovery request with "typeUrl": "istio.io/debug/config_dump", "resourceNames":["httpbin-774ddd6988-7czxl.default"], rather than "typeUrl":"istio.io/debug", "resourceNames":["config_dump?proxyID=httpbin-774ddd6988-7czxl.default"],

In fact, the current Istiod supports both formats. I wrote the handler for the first one, and Iris' debug handler does the second one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkinglifecycle/automatically-closedIndicates a PR or issue that has been closed automatically.lifecycle/staleIndicates a PR or issue hasn't been manipulated by an Istio team member for a while

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions