xref: /aosp_15_r20/external/grpc-grpc/doc/environment_variables.md (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1gRPC environment variables
2--------------------------
3
4gRPC C core based implementations (those contained in this repository) expose
5some configuration as environment variables that can be set.
6
7* grpc_proxy, https_proxy, http_proxy
8  The URI of the proxy to use for HTTP CONNECT support. These variables are
9  checked in order, and the first one that has a value is used.
10
11* no_grpc_proxy, no_proxy
12  A comma separated list of hostnames to connect to without using a proxy even
13  if a proxy is set. These variables are checked in order, and the first one
14  that has a value is used.
15
16* GRPC_ABORT_ON_LEAKS
17  A debugging aid to cause a call to abort() when gRPC objects are leaked past
18  grpc_shutdown(). Set to 1 to cause the abort, if unset or 0 it does not
19  abort the process.
20
21* GOOGLE_APPLICATION_CREDENTIALS
22  The path to find the credentials to use when Google credentials are created
23
24* GRPC_SSL_CIPHER_SUITES
25  A colon separated list of cipher suites to use with OpenSSL
26  Defaults to:
27    ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384
28
29* GRPC_DEFAULT_SSL_ROOTS_FILE_PATH
30  PEM file to load SSL roots from
31
32* GRPC_POLL_STRATEGY [posix-style environments only]
33  Declares which polling engines to try when starting gRPC.
34  This is a comma-separated list of engines, which are tried in priority order
35  first -> last.
36  Available polling engines include:
37  - epoll (linux-only) - a polling engine based around the epoll family of
38    system calls
39  - poll - a portable polling engine based around poll(), intended to be a
40    fallback engine when nothing better exists
41  - legacy - the (deprecated) original polling engine for gRPC
42
43* GRPC_TRACE
44  A comma separated list of tracers that provide additional insight into how
45  gRPC C core is processing requests via debug logs. Available tracers include:
46  - api - traces api calls to the C core
47  - bdp_estimator - traces behavior of bdp estimation logic
48  - call_error - traces the possible errors contributing to final call status
49  - cares_resolver - traces operations of the c-ares based DNS resolver
50  - cares_address_sorting - traces operations of the c-ares based DNS
51    resolver's resolved address sorter
52  - cds_lb - traces cds LB policy
53  - channel - traces operations on the C core channel stack
54  - channel_stack - traces the set of filters in a channel stack upon
55    construction
56  - client_channel - traces client channel control plane activity, including
57    resolver and load balancing policy interaction
58  - client_channel_call - traces client channel call activity related to name
59    resolution
60  - client_channel_lb_call - traces client channel call activity related
61    to load balancing picking
62  - compression - traces compression operations
63  - connectivity_state - traces connectivity state changes to channels
64  - cronet - traces state in the cronet transport engine
65  - dns_resolver - traces state in the native DNS resolver
66  - executor - traces grpc's internal thread pool ('the executor')
67  - glb - traces the grpclb load balancer
68  - handshaker - traces handshaking state
69  - health_check_client - traces health checking client code
70  - http - traces state in the http2 transport engine
71  - http2_stream_state - traces all http2 stream state mutations.
72  - http2_ping - traces pings/ping acks/antagonist writes in http2 stack.
73  - http1 - traces HTTP/1.x operations performed by gRPC
74  - inproc - traces the in-process transport
75  - http_keepalive - traces gRPC keepalive pings
76  - flowctl - traces http2 flow control
77  - op_failure - traces error information when failure is pushed onto a
78    completion queue
79  - pick_first - traces the pick first load balancing policy
80  - plugin_credentials - traces plugin credentials
81  - pollable_refcount - traces reference counting of 'pollable' objects (only
82    in DEBUG)
83  - priority_lb - traces priority LB policy
84  - resource_quota - trace resource quota objects internals
85  - ring_hash_lb - traces the ring hash load balancing policy
86  - rls_lb - traces the RLS load balancing policy
87  - round_robin - traces the round_robin load balancing policy
88  - weighted_round_robin_lb - traces the weighted_round_robin load balancing
89    policy
90  - queue_pluck
91  - grpc_authz_api - traces gRPC authorization
92  - server_channel - lightweight trace of significant server channel events
93  - secure_endpoint - traces bytes flowing through encrypted channels
94  - subchannel - traces the connectivity state of subchannel
95  - subchannel_pool - traces subchannel pool
96  - timer - timers (alarms) in the grpc internals
97  - timer_check - more detailed trace of timer logic in grpc internals
98  - transport_security - traces metadata about secure channel establishment
99  - tcp - traces bytes in and out of a channel
100  - tsi - traces tsi transport security
101  - weighted_target_lb - traces weighted_target LB policy
102  - xds_client - traces xds client
103  - xds_cluster_manager_lb - traces cluster manager LB policy
104  - xds_cluster_impl_lb - traces cluster impl LB policy
105  - xds_resolver - traces xds resolver
106
107  The following tracers will only run in binaries built in DEBUG mode. This is
108  accomplished by invoking `CONFIG=dbg make <target>`
109  - metadata - tracks creation and mutation of metadata
110  - combiner - traces combiner lock state
111  - call_combiner - traces call combiner state
112  - closure - tracks closure creation, scheduling, and completion
113  - fd_trace - traces fd create(), shutdown() and close() calls for channel fds.
114  - pending_tags - traces still-in-progress tags on completion queues
115  - polling - traces the selected polling engine
116  - polling_api - traces the api calls to polling engine
117  - subchannel_refcount
118  - queue_refcount
119  - error_refcount
120  - stream_refcount
121  - slice_refcount
122  - workqueue_refcount
123  - fd_refcount
124  - cq_refcount
125  - auth_context_refcount
126  - security_connector_refcount
127  - resolver_refcount
128  - lb_policy_refcount
129  - chttp2_refcount
130
131  'all' can additionally be used to turn all traces on.
132  Individual traces can be disabled by prefixing them with '-'.
133
134  'refcount' will turn on all of the tracers for refcount debugging.
135
136  if 'list_tracers' is present, then all of the available tracers will be
137  printed when the program starts up.
138
139  Example:
140  export GRPC_TRACE=all,-pending_tags
141
142* GRPC_VERBOSITY
143  Default gRPC logging verbosity - one of:
144  - DEBUG - log all gRPC messages
145  - INFO - log INFO and ERROR message
146  - ERROR - log only errors (default)
147  - NONE - won't log any
148
149* GRPC_STACKTRACE_MINLOGLEVEL
150  Minimum loglevel to print the stack-trace - one of DEBUG, INFO, ERROR, and NONE.
151  NONE is a default value.
152
153* GRPC_TRACE_FUZZER
154  if set, the fuzzers will output trace (it is usually suppressed).
155
156* GRPC_DNS_RESOLVER
157  Declares which DNS resolver to use. The default is ares if gRPC is built with
158  c-ares support. Otherwise, the value of this environment variable is ignored.
159  Available DNS resolver include:
160  - ares (default on most platforms except iOS, Android or Node)- a DNS
161    resolver based around the c-ares library
162  - native - a DNS resolver based around getaddrinfo(), creates a new thread to
163    perform name resolution
164
165  *NetBIOS and DNS*: If your network relies on NetBIOS name resolution or a mixture of
166  DNS and NetBIOS name resolution (e.g. in some Windows networks) then you should use
167  the '*native*' DNS resolver or make sure all NetBIOS names are
168  also configured in DNS. The '*ares*' DNS resolver only supports DNS name resolution.
169
170* GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
171  Default: 5000
172  Declares the interval between two backup polls on client channels. These polls
173  are run in the timer thread so that gRPC can process connection failures while
174  there is no active polling thread. They help reconnect disconnected client
175  channels (mostly due to idleness), so that the next RPC on this channel won't
176  fail. Set to 0 to turn off the backup polls.
177
178* grpc_cfstream
179  set to 1 to turn on CFStream experiment. With this experiment gRPC uses CFStream API to make TCP
180  connections. The option is only available on iOS platform and when macro GRPC_CFSTREAM is defined.
181