Documentation
¶
Overview ¶
Package graphite contains a Graphite exporter that supports exporting OpenCensus views as Graphite metrics.
Example ¶
package main
import (
"log"
"net/http"
"contrib.go.opencensus.io/exporter/graphite"
"go.opencensus.io/stats/view"
)
func main() {
exporter, err := graphite.NewExporter(graphite.Options{})
if err != nil {
log.Fatal(err)
}
view.RegisterExporter(exporter)
// Serve the scrape endpoint on port 9999.
log.Fatal(http.ListenAndServe(":9999", nil))
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter exports stats to Graphite
func NewExporter ¶
NewExporter returns an exporter that exports stats to Graphite.
func (*Exporter) ExportView ¶
ExportView exports to the Graphite if view data has one or more rows. Each OpenCensus stats records will be converted to corresponding Graphite Metric
type Options ¶
type Options struct {
// Host contains de host address for the graphite server.
// The default value is "127.0.0.1".
Host string
// Port is the port in which the carbon endpoint is available.
// The default value is 2003.
Port int
// Namespace is optional and will be the first element in the path.
Namespace string
// Tags specifies a set of default tags to attach to each metric.
// Tags is optional and will work only for Graphite above 1.1.x.
// Example : []string{"tagName1=tagValue1", "tagName2=tagValue2"}
Tags []string
// OnError is the hook to be called when there is
// an error uploading the stats or tracing data.
// If no custom hook is set, errors are logged.
// Optional.
OnError func(err error)
}
Options contains options for configuring the exporter.
Directories
¶
| Path | Synopsis |
|---|---|
|
Command graphite is an example program that collects data for video size.
|
Command graphite is an example program that collects data for video size. |
|
grpc/helloworld_client
command
|
|
|
grpc/helloworld_server
command
|
|
|
grpc/proto
Package helloworld is a generated protocol buffer package.
|
Package helloworld is a generated protocol buffer package. |
|
internal
|
|
Click to show internal directories.
Click to hide internal directories.



