11# OpenCensus Stackdriver Stats Exporter
22
3- The * OpenCensus Stackdriver Stats Exporter* is a stats exporter that exports
3+ The * OpenCensus Stackdriver Stats Exporter* is a stats exporter that exports
44data to [ Stackdriver Monitoring] ( stackdriver-monitoring ) .
55
66## Quickstart
@@ -19,13 +19,13 @@ In order to be able to push your stats to [Stackdriver Monitoring](stackdriver-m
1919These steps enable the API but don't require that your app is hosted on Google Cloud Platform.
2020
2121### Setup authentication
22- The Stackdriver exporter uses gRPC, which requires a certificate
22+ The Stackdriver exporter uses gRPC, which requires a certificate
2323(` etc/roots.pem ` in the gRPC repository) copied to
2424to ` /usr/share/grpc/roots.pem ` .
2525
26- If your application runs on Google Cloud Platform, it can automatically
26+ If your application runs on Google Cloud Platform, it can automatically
2727determine credentials to authenticate to Stackdriver from the VM environment.
28- Otherwise, create a
28+ Otherwise, create a
2929[ Google Cloud service account] ( https://cloud.google.com/iam/docs/creating-managing-service-accounts )
3030with the "Monitoring Editor" role, create and download a service account key,
3131and set the environment variable ` GOOGLE_APPLICATION_CREDENTIALS ` to the path to
@@ -34,7 +34,7 @@ that key.
3434### Register the exporter
3535
3636` #include opencensus/exporters/stats/stackdriver/stackdriver_exporter.h ` (if
37- using Bazel, this requires a dependency on
37+ using Bazel, this requires a dependency on
3838` "@io_opencensus_cpp//exporters/stats/stackdriver:stackdriver_exporter" ` ).
3939In your application's initialization code, register the exporter:
4040``` c++
@@ -46,21 +46,21 @@ opencensus::exporters::stats::StackdriverExporter::Register(
4646 "my-stackdriver-project-id", opencensus_task);
4747```
4848The `opencensus_task` may be anything, but must be unique among all exporters
49- simultaneously exporting to Stackdriver concurrently; the format
49+ simultaneously exporting to Stackdriver concurrently; the format
5050`"cpp-${PROCESS_ID}@${HOSTNAME}"` is recommended.
5151
5252### Register views and record stats
5353
5454Once the exporter has been registered, any stats for views registered with
55- `ViewDescriptor::RegisterForExport()` will be exported. Views may be registered
55+ `ViewDescriptor::RegisterForExport()` will be exported. Views may be registered
5656before or after the exporter, and will track stats since the registration of the
5757view in either case.
5858
5959## Data model
6060
6161### View metadata
6262
63- OpenCensus exports views as custom metrics under the
63+ OpenCensus exports views as custom metrics under the
6464[Global](https://cloud.google.com/monitoring/api/resources#tag_global)
6565monitored resource. For each view, OpenCensus creates a Stackdriver metric. This
6666metric's name will be under the path `"custom.googleapis.com/opencensus/"`, so
@@ -71,7 +71,7 @@ to a Stackdriver metric named
7171Only Cumulative views may be registered for export in OpenCensus, and created
7272Stackdriver metrics have the `CUMULATIVE` type.
7373
74- View columns translate to Stackdriver's labels. OpenCensus adds a label
74+ View columns translate to Stackdriver's labels. OpenCensus adds a label
7575`"opencensus_task"` to all exported views so that exports from different
7676processes do not conflict.
7777
@@ -81,9 +81,8 @@ For each row of the view's data (a unique combination of tag values) OpenCensus
8181exports a separate `TimeSeries` with label values corresponding to the row's tag
8282values.
8383
84- The Stackdriver data type depends on the
85- view's measure type and aggregation--count aggregation to `INT64`, sum
84+ The Stackdriver data type depends on the
85+ view's measure type and aggregation--count aggregation to `INT64`, sum
8686aggregation to `INT64` for `MeasureInt` and `DOUBLE` for `MeasureDouble`, and
8787distribution aggregation to `DISTRIBUTION`. Exported distributions omit the
8888range as it is not supported by Stackdriver.
89-
0 commit comments