The OpenCensus SignalFx Stats Exporter for Go is a stats exporter that exports data to SignalFx, a real-time monitoring solution for cloud and distributed applications. SignalFx ingests that data and offers various visualizations on charts, dashboards and service maps, as well as real-time anomaly detection.
import "opencensus-go-signalfx/exporter/signalfx"
The API of this project is still evolving. The use of vendoring or a dependency management tool is recommended.
To use this exporter, one must have a SignalFx account and corresponding data ingest token.
OpenCensus Go libraries require Go 1.8 or later.
func main() {
// SignalFx token is part of the Options struct.
// Stats will be reported every second by default.
exporter, err := signalfx.NewExporter(signalfx.Options{Token: "token"})
...
}
It is possible to set a different endpoint for SignalFx, use:
func main() {
exporter, err := signalfx.NewExporter(signalfx.Options{Token: "token", DatapointEndpoint: "Endpoint"})
....
}
It is possible to set different reporting intervals by using SetReportingPeriod()
, for example:
func main() {
exporter, err := signalfx.NewExporter(signalfx.Options{Token: "token"})
view.RegisterExporter(exporter)
....
view.SetReportingPeriod(5 * time.Second)
}