Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit af429f6

Browse files
author
Ian Sturdy
authored
Update documentation and diagnostics for the gRPC example. (#84)
* Quote IP on the command line in instructions. * Report an error message when not exporting a view due to a changed descriptor.
1 parent f663320 commit af429f6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/grpc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To increase gRPC verbosity, try:
2222

2323
```shell
2424
env GRPC_VERBOSITY=DEBUG ../../bazel-bin/examples/grpc/hello_server 9001
25-
env GRPC_VERBOSITY=DEBUG ../../bazel-bin/examples/grpc/hello_client [::]:9001
25+
env GRPC_VERBOSITY=DEBUG ../../bazel-bin/examples/grpc/hello_client "[::]:9001"
2626
```
2727

2828
## Stackdriver

opencensus/exporters/stats/stackdriver/internal/stackdriver_exporter.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ bool StackdriverExporter::Handler::MaybeRegisterView(
118118
const opencensus::stats::ViewDescriptor& descriptor) {
119119
const auto& it = registered_descriptors_.find(descriptor.name());
120120
if (it != registered_descriptors_.end()) {
121-
return it->second == descriptor;
121+
if (it->second != descriptor) {
122+
std::cerr << "Not exporting altered view: " << descriptor.DebugString()
123+
<< "\nAlready registered as: " << it->second.DebugString()
124+
<< "\n";
125+
return false;
126+
}
127+
return true;
122128
}
123129

124130
auto request = google::monitoring::v3::CreateMetricDescriptorRequest();

0 commit comments

Comments
 (0)