gRPC State Monitoring

The yumaworks-grpc-mon.yang module can be used to retrieve gRPC monitoring data from the netconfd-pro server.

gRPC Monitoring Example

Run the server with the setting --with-grpc=true flag as follows:

mydir> sudo netconfd-pro --log-level=debug4 --with-grpc=true --fileloc-fhs=true

Start the ypgrpc-go-app application in “insecure” mode for this scenario:

mydir> ypgrpc-go-app --log-level=debug --fileloc-fhs --insecure \
   --protopath=$HOME/protos --proto=helloworld --proto=example

There is an option to check the gRPC server capabilities by sending <get> request to the netconfd-pro server as follows with a RESTCONF GET request:

> curl http://restconf-dev/restconf/data/grpc-state \
    -H "Accept:application/yang-data+json"

The server may respond as follows:

{
    "yumaworks-grpc-mon:grpc-state": {
        "statistics": {
            "active-server-streams": 0,
            "active-client-streams": 0,
            "total-active-streams": 0,
            "total-closed-streams": 0
        },
        "server": [
            {
                "name": "example-grpc",
                "address": "192.168.0.216",
                "port": 50830,
                "start-time": "2021-10-21T00:27:00Z",
                "proto": [
                    "example"
                ],
                "active-server-streams": 0,
                "active-client-streams": 0,
                "closed-streams": 0,
                "services": {
                    "service": [
                        {
                            "name": "example.ExampleService",
                            "method": [
                                {
                                    "name": "EmptyCall",
                                    "client-streaming": false,
                                    "server-streaming": false
                                },
                                {
                                    "name": "FullDuplexCall",
                                    "client-streaming": true,
                                    "server-streaming": true
                                },
                                {
                                    "name": "HalfDuplexCall",
                                    "client-streaming": true,
                                    "server-streaming": true
                                },
                                {
                                    "name": "StreamingInputCall",
                                    "client-streaming": true,
                                    "server-streaming": false
                                },
                                {
                                    "name": "StreamingOutputCall",
                                    "client-streaming": false,
                                    "server-streaming": true
                                },
                                {
                                    "name": "UnaryCall",
                                    "client-streaming": false,
                                    "server-streaming": false
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }
}

<grpc-shutdown> Operation

The <grpc-shutdown> operation is used to shut down the ypgrpc-go-app application.

By default, only the 'superuser' account is allowed to invoke this operation.

If permission is granted, then the netconfd-pro server will send request to shutdown the ypgrpc-go-app application and its gRPC server. All gRPC streams will be dropped, during the ypgrpc-go-app application shutdown.

<grpc-shutdown> operation

Min parameters:

0

Max parameters:

0

Return type:

none

YANG file:

yumaworks-grpc-mon.yang

Capabilities needed:

none

Mandatory Parameters:

  • none

Optional Parameters:

  • none

Returns:

  • none; ypgrpc-go-app will be shutdown upon success

Possible Operation Errors:

  • access denied

Example Request:

<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="2"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <grpc-shutdown xmlns="http://yumaworks.com/ns/yumaworks-grpc-mon"/>
</rpc>

Example Reply:

[no reply will be sent; ypgrpc-go-app will be shutdown instead.]