Documentation ¶
Overview ¶
Package tags implements an rep-mgr informer publishes user-defined tags as metrics.
Index ¶
Constants ¶
const (
DefaultMetricTTL = 30 * time.Second
)
Default values for tags Config
Variables ¶
var (
DefaultTags = map[string]string{
"group": "default",
}
)
Default values for tags config
var MetricName = "tags"
MetricName specifies the name of our metric
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config is used to initialize an Informer and customize the type and parameters of the metric it produces.
func (*Config) ApplyEnvVars ¶
ApplyEnvVars fills in any Config fields found as environment variables.
func (*Config) LoadJSON ¶
LoadJSON reads the fields of this Config from a JSON byteslice as generated by ToJSON.
func (*Config) ToDisplayJSON ¶
ToDisplayJSON returns JSON config as a string.
type Informer ¶
type Informer struct {
// contains filtered or unexported fields
}
Informer is a simple object to implement the ipfscluster.Informer and Component interfaces.
func (*Informer) GetMetrics ¶
GetMetrics returns one metric for each tag defined in the configuration. The metric name is set as "tags:<tag_name>". When no tags are defined, a single invalid metric is returned.
func (*Informer) Name ¶
Name returns the name of this informer. Note the informer issues metrics with custom names.