|
24 | 24 | // Alternatively, pass the authentication options in both the MonitoringClientOptions |
25 | 25 | // and the TraceClientOptions fields of Options. |
26 | 26 | // |
27 | | -// Stackdriver Monitoring |
| 27 | +// # Stackdriver Monitoring |
28 | 28 | // |
29 | 29 | // This exporter support exporting OpenCensus views to Stackdriver Monitoring. |
30 | 30 | // Each registered view becomes a metric in Stackdriver Monitoring, with the |
|
35 | 35 | // |
36 | 36 | // In order to be able to push your stats to Stackdriver Monitoring, you must: |
37 | 37 | // |
38 | | -// 1. Create a Cloud project: https://support.google.com/cloud/answer/6251787?hl=en |
39 | | -// 2. Enable billing: https://support.google.com/cloud/answer/6288653#new-billing |
40 | | -// 3. Enable the Stackdriver Monitoring API: https://console.cloud.google.com/apis/dashboard |
| 38 | +// 1. Create a Cloud project: https://support.google.com/cloud/answer/6251787?hl=en |
| 39 | +// 2. Enable billing: https://support.google.com/cloud/answer/6288653#new-billing |
| 40 | +// 3. Enable the Stackdriver Monitoring API: https://console.cloud.google.com/apis/dashboard |
41 | 41 | // |
42 | 42 | // These steps enable the API but don't require that your app is hosted on Google Cloud Platform. |
43 | 43 | // |
44 | | -// Stackdriver Trace |
| 44 | +// # Stackdriver Trace |
45 | 45 | // |
46 | 46 | // This exporter supports exporting Trace Spans to Stackdriver Trace. It also |
47 | 47 | // supports the Google "Cloud Trace" propagation format header. |
@@ -418,12 +418,15 @@ func (e *Exporter) ExportMetrics(ctx context.Context, metrics []*metricdata.Metr |
418 | 418 | // from all registered producers at set interval and exports them. |
419 | 419 | // Use StopMetricsExporter to stop exporting metrics. |
420 | 420 | // Previously, it required registering exporter to export stats collected by opencensus. |
421 | | -// exporter := stackdriver.NewExporter(stackdriver.Option{}) |
422 | | -// view.RegisterExporter(exporter) |
| 421 | +// |
| 422 | +// exporter := stackdriver.NewExporter(stackdriver.Option{}) |
| 423 | +// view.RegisterExporter(exporter) |
| 424 | +// |
423 | 425 | // Now, it requires to call StartMetricsExporter() to export stats and metrics collected by opencensus. |
424 | | -// exporter := stackdriver.NewExporter(stackdriver.Option{}) |
425 | | -// exporter.StartMetricsExporter() |
426 | | -// defer exporter.StopMetricsExporter() |
| 426 | +// |
| 427 | +// exporter := stackdriver.NewExporter(stackdriver.Option{}) |
| 428 | +// exporter.StartMetricsExporter() |
| 429 | +// defer exporter.StopMetricsExporter() |
427 | 430 | // |
428 | 431 | // Both approach should not be used simultaneously. Otherwise it may result into unknown behavior. |
429 | 432 | // Previous approach continues to work as before but will not report newly define metrics such |
|
0 commit comments