grpc-java/examples/example-gcp-observability
Eric Anderson c985797d90
Upgrade dependencies
All the changes outside libs.versions.toml and examples were
because of ErrorProne. It didn't actually find anything to fix; signal
vs noise has gotten pretty bad with the newer checks.

Status was changed for ErrorProne's SuperCallToObjectMethod. With the
old code it didn't notice the trivial implementation. The fail-for-test
code wasn't used, so it was easiest to just remove it.

Some of the libs had their versions inlined; now that we have
:checkForUpdates it isn't much of a risk for versions to diverge when
there's only a few artifacts sharing a version. If we need 4+ artifacts
to have the same version, then it makes sense to still use a shared
version.

Dependencies not upgraded: google-auth-libray, mockito, netty, cronet
2023-12-12 12:40:20 -08:00
..
src/main examples: add gcp-observability examples (#9967) 2023-03-22 17:02:25 -07:00
README.md examples: add gcp-observability examples (#9967) 2023-03-22 17:02:25 -07:00
build.gradle Upgrade dependencies 2023-12-12 12:40:20 -08:00
settings.gradle examples: add gcp-observability examples (#9967) 2023-03-22 17:02:25 -07:00

README.md

gRPC GCP Observability Example

The GCP Observability example consists of a Hello World client and a Hello World server instrumented for logs, metrics and tracing.

Please refer to Microservices Observability user guide for setup.

Build the example

Build the Observability client & server. From the grpc-java/examples/example-gcp-observability directory:

$ ../gradlew installDist

This creates the scripts build/install/example-gcp-observability/bin/gcp-observability-client and build/install/example-gcp-observability/bin/gcp-observability-server.

Run the example with configuration

To use Observability, you should first setup and configure authorization as mentioned in the user guide.

You need to set the GRPC_GCP_OBSERVABILITY_CONFIG_FILE environment variable to point to the gRPC GCP Observability configuration file (preferred) or if that is not set then GRPC_GCP_OBSERVABILITY_CONFIG environment variable to gRPC GCP Observability configuration value. This is needed by both build/install/example-gcp-observability/bin/gcp-observability-client and build/install/example-gcp-observability/bin/gcp-observability-server.

  1. To start the observability-enabled example server on its default port of 50051, run:
$ export GRPC_GCP_OBSERVABILITY_CONFIG_FILE=src/main/resources/io/grpc/examples/gcpobservability/gcp_observability_server_config.json
$ ./build/install/example-gcp-observability/bin/gcp-observability-server
  1. In a different terminal window, run the observability-enabled example client:
$ export GRPC_GCP_OBSERVABILITY_CONFIG_FILE=src/main/resources/io/grpc/examples/gcpobservability/gcp_observability_client_config.json
$ ./build/install/example-gcp-observability/bin/gcp-observability-client