Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update stackdriver examples for tracing and stats #613

Merged
merged 2 commits into from Feb 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -258,6 +258,8 @@ StackdriverTraceExporter.createAndRegister(
.setProjectId("YOUR_PROJECT_ID")
.build());
```
You can view the traces on the Google Cloud Platform Console
[Trace](https://console.cloud.google.com/traces) page.

By default traces are [sampled](https://opencensus.io/tracing/sampling) at a rate of about 1/10,000.
You can configure a higher rate by updating the active tracing params:
Expand Down Expand Up @@ -376,6 +378,28 @@ BigtableDataSettings.enableOpenCensusStats();
BigtableDataSettings.enableGfeOpenCensusStats();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I"m not sure that this line works still. Or at least it didn't compile when I tried using it I think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah.. Looks like this change is not released yet

```

You can view the metrics on the Google Cloud Platform Console
[Metrics explorer](https://console.cloud.google.com/monitoring/metrics-explorer)
page.

You can configure how frequent metrics are pushed to StackDriver and the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: frequently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: may be nicer to inline these suggestions into the example below. People may read code more easily than documentation

esp. for monitored resource, we want to encourage users to choose their own instead of just going w/ global.

[Monitor Resource](https://cloud.google.com/monitoring/api/resources) by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better phrasing: Monitored Resource

updating the stats configuration:

``` java
// set export interval to 10 seconds and monitor resource to global
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Prefix this comment w/ Example, just to make it clear this isn't the standard way to do it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably don't need the specified monitored resource too. Can we link to the Java doc for this so people can easily see all the options?

StackdriverStatsExporter.createAndRegister(
StackdriverStatsConfiguration.builder()
.setProjectId("YOUR_PROJECT_ID")
.setExportInterval(Duration.create(10, 0))
.setMonitoredResource(MonitoredResource.newBuilder()
.setType("global")
.putLabels("project_id", "YOUR_PROJECT_ID")
.build())
.build()
);
```

## Version Conflicts

google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought
Expand Down