Skip to content

Commit 8138912

Browse files
chore(storage): Add example for GrpcChannelArgumentsNativeOption (#15733)
1 parent 601c5b8 commit 8138912

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

google/cloud/grpc_options.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ struct GrpcChannelArgumentsOption {
104104
* use the first value set for some channel arguments, and the last value set
105105
* for others.
106106
*
107+
* @par Example
108+
* To configure gRPC's maximum metadata size to 32MiB (which can be useful
109+
* to avoid `RESOURCE_EXHAUSTED` errors when exporting gRPC metrics),
110+
* you can use:
111+
* @code
112+
* google::cloud::Options options;
113+
* grpc::ChannelArguments args;
114+
* args.SetInt(GRPC_ARG_MAX_METADATA_SIZE, 32 * 1024 * 1024);
115+
* options.set<google::cloud::GrpcChannelArgumentsNativeOption>(args);
116+
* @endcode
117+
*
107118
* @see https://grpc.github.io/grpc/cpp/classgrpc_1_1_channel_arguments.html
108119
* @see https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
109120
*

0 commit comments

Comments
 (0)