Documentation ¶
Index ¶
Constants ¶
View Source
const ( // display attributes Color = "color" DisplayMax = "display_max" DisplayMin = "display_min" DisplayUnitsLong = "display_units_long" DisplayUnitsShort = "display_units_short" DisplayStacked = "display_stacked" DisplayTransform = "display_transform" // special gauge display attributes SummarizeFunction = "summarize_function" Aggregate = "aggregate" // metric keys Name = "name" Period = "period" Description = "description" DisplayName = "display_name" Attributes = "attributes" // measurement keys Time = "time" Tags = "tags" Value = "value" // special gauge keys Count = "count" Sum = "sum" Max = "max" Min = "min" StdDev = "stddev" // batch keys Measurements = "measurements" MetricsPostUrl = "https://api.appoptics.com/v1/measurements" )
property strings
View Source
const Operations = "operations"
View Source
const OperationsShort = "ops"
Variables ¶
This section is empty.
Functions ¶
func AppOptics ¶
func AppOptics(registry metrics.Registry, interval time.Duration, token string, tags map[string]string, percentiles []float64, timeUnits time.Duration, prefix string, whitelistedRuntimeMetrics []string)
Call in a goroutine to start metric uploading. Using whitelistedRuntimeMetrics: a non-nil value sets this reporter to upload only a subset of the runtime.* metrics that are gathered by go-metrics runtime memory stats (CaptureRuntimeMemStats). The full list of possible values is at https://github.com/rcrowley/go-metrics/blob/master/runtime.go#L181-L211 Passing an empty slice disables uploads for all runtime.* metrics.
func SetHTTPClient ¶
Types ¶
type AppOpticsClient ¶
type AppOpticsClient struct {
Token string
}
func (*AppOpticsClient) PostMetrics ¶
func (self *AppOpticsClient) PostMetrics(batch Batch) (err error)
type Batch ¶
type Batch struct { Measurements []Measurement `json:"measurements,omitempty"` Time int64 `json:"time"` Tags map[string]string `json:"tags"` }
type Measurement ¶
type Measurement map[string]interface{}
type Reporter ¶
type Reporter struct { Token string Tags map[string]string Interval time.Duration Registry metrics.Registry Percentiles []float64 // percentiles to report on histogram metrics Prefix string // prefix metric names for upload (eg "servicename.") WhitelistedRuntimeMetrics map[string]bool // runtime.* metrics to upload (nil = allow all) TimerAttributes map[string]interface{} // units in which timers will be displayed // contains filtered or unexported fields }
func NewReporter ¶
func (*Reporter) BuildRequest ¶
Click to show internal directories.
Click to hide internal directories.