| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This example uses:
Usage:
bazel build :all
../../bazel-bin/examples/grpc/hello_server 9001
../../bazel-bin/examples/grpc/hello_client "[::]:9001"You can see the Prometheus stats on http://127.0.0.1:8080/metrics
To increase gRPC verbosity, try:
env GRPC_VERBOSITY=DEBUG ../../bazel-bin/examples/grpc/hello_server 9001
env GRPC_VERBOSITY=DEBUG ../../bazel-bin/examples/grpc/hello_client "[::]:9001"In order to be able to push your stats to Stackdriver Monitoring, you must:
To use our Stackdriver Stats exporter, your Stackdriver account needs to have permission to create custom metrics, and that requires a Premium tier Stackdriver account. Please note that by default all new Stackdriver accounts are Basic tier. To upgrade to a Premium tier Stackdriver account, follow the instructions here.
Log in to a GCE instance:
gcloud compute --project myproject ssh myinstanceInstall the build tools:
sudo apt install pkg-config zip g++ zlib1g-dev unzip python
wget https://github.com/bazelbuild/bazel/releases/download/0.11.0/bazel-0.11.0-installer-linux-x86_64.sh
chmod +x bazel-0.11.0-installer-linux-x86_64.sh
./bazel-0.11.0-installer-linux-x86_64.sh --userBuild the example:
git clone https://github.com/census-instrumentation/opencensus-cpp.git
cd opencensus-cpp/examples/grpc
bazel build :allInstall the gRPC certificates on the VM: (you only need to do this once)
sudo mkdir -p /usr/share/grpc
sudo cp $(bazel info output_base)/external/com_github_grpc_grpc/etc/roots.pem /usr/share/grpc/roots.pemRun the server but set STACKDRIVER_PROJECT_ID, e.g.:
env STACKDRIVER_PROJECT_ID=myproject ../../bazel-bin/examples/grpc/hello_server 9001
env STACKDRIVER_PROJECT_ID=myproject ../../bazel-bin/examples/grpc/hello_client [::]:9001When running on GCE, the credentials used to authenticate to Stackdriver are determined automatically from the VM.
Go to https://console.cloud.google.com/monitoring to see stats:
Example:
Go to https://console.cloud.google.com/traces/traces to see traces. Example:
| Back | FazBrowse Home | New Git URL |