Documentation ¶
Index ¶
- Constants
- func CanonicalMetricName(s string) string
- func InstallNewPipeline(opts ...Option) (*push.Controller, error)
- func JoinMetricName(elem ...string) string
- func NewExportPipeline(opts ...Option) (*push.Controller, error)
- func NewGraphDef(name string, kind export.MetricKind, opts GraphDefOptions) (*mackerel.GraphDefsParam, error)
- func PercentileName(q float64) string
- func UnmarshalLabels(labels []core.KeyValue, v interface{}) error
- func WithAPIKey(apiKey string) func(o *options)
- func WithHints(hints []string) func(o *options)
- func WithQuantiles(quantiles []float64) func(o *options)
- type CloudResource
- type Exporter
- type GraphDefOptions
- type HostResource
- type InstanceResource
- type MetricName
- type Option
- type Resource
- type ServiceResource
Constants ¶
const ( UnitDimensionless = unit.Dimensionless UnitBytes = unit.Bytes UnitMilliseconds = unit.Milliseconds )
Variables ¶
This section is empty.
Functions ¶
func CanonicalMetricName ¶
CanonicalMetricName returns canonical metric name.
func InstallNewPipeline ¶
func InstallNewPipeline(opts ...Option) (*push.Controller, error)
InstallNewPipeline instantiates a NewExportPipeline and registers it globally.
func JoinMetricName ¶
JoinMetricName joins any number of name elements int a single name.
func NewExportPipeline ¶
func NewExportPipeline(opts ...Option) (*push.Controller, error)
NewExportPipeline sets up a complete export pipeline.
func NewGraphDef ¶
func NewGraphDef(name string, kind export.MetricKind, opts GraphDefOptions) (*mackerel.GraphDefsParam, error)
NewGraphDef returns Mackerel's Graph Definition. Each names in arguments must be canonicalized.
func UnmarshalLabels ¶
UnmarshalLabels parses labels and store the result into v.
func WithAPIKey ¶
func WithAPIKey(apiKey string) func(o *options)
WithAPIKey sets the Mackerel API Key.
func WithHints ¶
func WithHints(hints []string) func(o *options)
WithHints sets hints for decision the name of the Graph Definition.
func WithQuantiles ¶
func WithQuantiles(quantiles []float64) func(o *options)
WithQuantiles sets quantiles for recording measure metrics. Each quantiles must be unique and its precision must be greater or equal than 0.01.
Types ¶
type CloudResource ¶
type CloudResource struct {
Provider string `resource:"provider"`
}
CloudResource represents the standard cloud attributes.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter is a stats exporter that uploads data to Mackerel.
func NewExporter ¶
NewExporter creates a new Exporter.
type GraphDefOptions ¶
GraphDefOptions represents options for customizing Mackerel's Graph Definition.
type HostResource ¶
HostResource represents the standard host attributes.
type InstanceResource ¶
type InstanceResource struct {
ID string `resource:"id"`
}
InstanceResource represents the standard instance attributes.
type MetricName ¶
type MetricName string
func (MetricName) Match ¶
func (g MetricName) Match(s string) bool
type Option ¶
type Option func(*options)
Option is function type that is passed to NewExporter function.
type Resource ¶
type Resource struct { Service ServiceResource `resource:"service"` Host HostResource `resource:"host"` Cloud CloudResource `resource:"cloud"` }
Resource represents a resource constructed with labels.
func (*Resource) CustomIdentifier ¶
CustomIdentifier returns a proper customIdentifier for the host.
type ServiceResource ¶
type ServiceResource struct { Name string `resource:"name"` NS string `resource:"namespace"` Instance InstanceResource `resource:"instance"` Version string `resource:"version"` }
ServiceResource represents the standard service attributes.