Skip to content

Commit

Permalink
Enable GRPC log for GNMI (sonic-net#20798)
Browse files Browse the repository at this point in the history
#### Why I did it
Currently, we don't have GRPC logs for the GNMI server, making it difficult to debug GRPC-level issues such as invalid certificates.

#### How I did it
Update gnmi-native.sh to enable GRPC_GO_LOG.

#### How to verify it
Send gnmi request and check gnmi log, for example:
2024 Nov 13 07:35:03.454423 str3 INFO gnmi#supervisord: gnmi-native WARNING: 2024/11/13 07:35:03 [core] grpc: Server.Serve failed to complete security handshake from "127.0.0.1:43530": tls: failed to verify client certificate: x509: certificate signed by unknown authority
  • Loading branch information
ganglyu authored Nov 19, 2024
1 parent daa5b03 commit 59f39d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dockers/docker-sonic-gnmi/gnmi-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ X509=$(echo $TELEMETRY_VARS | jq -r '.x509')
GNMI=$(echo $TELEMETRY_VARS | jq -r '.gnmi')
CERTS=$(echo $TELEMETRY_VARS | jq -r '.certs')

# Enable GRPC GO LOG
export GRPC_GO_LOG_VERBOSITY_LEVEL=99
export GRPC_GO_LOG_SEVERITY_LEVEL=info

TELEMETRY_ARGS=" -logtostderr"
export CVL_SCHEMA_PATH=/usr/sbin/schema

Expand Down

0 comments on commit 59f39d4

Please sign in to comment.