grpc/examples/cpp/csm
Yash Tibrewal cb6eaeb4f0 [CSM O11y] Follow-up from #36806 (#36823)
Closes #36823

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36823 from yashykt:CsmObsEgFollowup b5d0dcd455
PiperOrigin-RevId: 640632444
2024-06-05 13:36:16 -07:00
..
observability [CSM O11y] Follow-up from #36806 (#36823) 2024-06-05 13:36:16 -07:00
BUILD [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36359) 2024-04-15 20:56:16 -07:00
Dockerfile.client [examples] Update SSA client example (#35799) 2024-02-02 15:42:19 -08:00
Dockerfile.server [CSM] Add CSM Example client and server images (#34447) 2023-09-24 12:07:17 -07:00
README.md [examples] Update SSA client example (#35799) 2024-02-02 15:42:19 -08:00
csm_greeter_client.cc [CSM] De-experimentalize CsmObservability API (#35836) 2024-02-09 09:28:18 -08:00
csm_greeter_server.cc [grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT (#36359) 2024-04-15 20:56:16 -07:00

README.md

gRPC C++ CSM Hello World Example

This CSM example builds on the Hello World Example and changes the gRPC client and server to accept configuration from an xDS control plane and test SSA and CSM observability

Configuration

The client takes the following command-line arguments -

  • target - By default, the client tries to connect to the xDS "xds:///helloworld:50051" and gRPC would use xDS to resolve this target and connect to the server backend. This can be overriden to change the target.
  • cookie_name - session affinity cookie name. Defaults to "GSSA"
  • delay_s - delay (in seconds) between the RPCs. Default value is 5

The server takes the following command-line arguments -

  • port - Port on which the Hello World service is run. Defaults to 50051.

Building

From the gRPC workspace folder:

Client:

docker build -f examples/cpp/csm/Dockerfile.client

Server:

docker build -f examples/cpp/csm/Dockerfile.server

To push to a registry, add a tag to the image either by adding a -t flag to docker build command above or run:

docker image tag ${sha from build command above} ${tag}

And then push the tagged image using docker push