grpc-java/examples/example-gcp-observability
Eric Anderson f3f4ed4ef3 Upgrade to Gradle 8.2.1 and upgrade plugins
Most changes are migrating from conventions to the equivalent
extensions. JMH, AppEngine, and Jib plugins trigger future compatibility
warnings with `--warning-mode all`.

The movement of configurations was to allow sourceSets to create the
configurations and then we just configure them. When configurations were
before sourceSets, we'd implicitly create the configuration.

The examples were _not_ updated to the newer Gradle, although the
non-Android examples work with the newer Gradle. The Android examples
use an older Android Gradle Plugin which will need to be upgraded first.
https://github.com/grpc/grpc-java/issues/10445
2023-08-02 13:29:44 -07: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 to Gradle 8.2.1 and upgrade plugins 2023-08-02 13:29:44 -07: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