This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f0375f8
commit c81a465
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Troubleshooting gRPC | ||
|
||
This guide is for troubleshooting gRPC implementations based on C core library (sources for most of them are living in the `grpc/grpc` repository). | ||
|
||
## Enabling extra logging and traces | ||
|
||
Extra logging can be very useful for diagnosing problems. All gRPC implementations based on C core library support | ||
the `GRPC_VERBOSITY` and `GRPC_TRACE` environment variables that can be used to increase the amount of information | ||
that gets printed to stderr. | ||
|
||
## GRPC_VERBOSITY | ||
|
||
`GRPC_VERBOSITY` is used to set the minimum level of log messages printed by gRPC (supported values are `DEBUG`, `INFO` and `ERROR`). | ||
|
||
## GRPC_TRACE | ||
|
||
`GRPC_TRACE` can be used to enable extra logging for some internal gRPC components. Enabling the right traces can be invaluable | ||
for diagnosing for what is going wrong when things aren't working as intended. Possible values for GRPC_TRACE are listed in [Environment Variables Overview](doc/environment_variables.md). | ||
Multiple traces can be enable at once (use comma as separator). | ||
|
||
``` | ||
# Enable debug logs for an application | ||
GRPC_VERBOSITY=debug ./helloworld_application_using_grpc | ||
``` | ||
|
||
``` | ||
# Print info about invocations of low-level C core API. | ||
# Note that trace logs of log level DEBUG won't be displayed | ||
# as GRPC_VERBOSITY and GRPC_TRACE are 2 independent settings. | ||
GRPC_TRACE=api ./helloworld_application_using_grpc | ||
``` | ||
|
||
``` | ||
# Print info from 3 different tracers, including tracing logs with log level DEBUG | ||
GRPC_VERBOSITY=debug GRPC_TRACE=tcp,http,api ./helloworld_application_using_grpc | ||
``` | ||
|
||
Known limitations: `GPRC_TRACE=tcp` is currently not implemented for Windows (you won't see any tcp traces). | ||
|
||
Please note that the GRPC_TRACE environment variable has nothing to do with gRPC's "tracing" feature (= tracing RPCs in | ||
microservice environment to gain insight about how requests are processed by deployment), it is merely used to enable printing | ||
of extra logs. |