Created
March 18, 2018 14:06
-
-
Save avivl/15fd071ca0212838aebec2e45430eb1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "go.opencensus.io/exporter/prometheus" | |
| "go.opencensus.io/exporter/stackdriver" | |
| "go.opencensus.io/stats/view" | |
| ) | |
| Exporter, err := prometheus.NewExporter(prometheus.Options{}) | |
| if err != nil { | |
| logger.Error("Error creating prometheus exporter ", zap.Error(err)) | |
| } | |
| // Export to Prometheus Monitoring. | |
| view.RegisterExporter(pExporter) | |
| sExporter, err := stackdriver.NewExporter(stackdriver.Options{ProjectID: config.ProjectID}) | |
| if err != nil { | |
| logger.Error("Error creating stackdriver exporter ", zap.Error(err)) | |
| } | |
| // Export to Stackdriver Monitoring. | |
| view.RegisterExporter(sExporter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment