Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { From *url.URL ToAuthorize *url.URL ToUpload *url.URL FromToken string ToToken string FromTokenFile string ToTokenFile string FromCAFile string TLSCertFile string TLSKey string AnonymizeLabels []string AnonymizeSalt string AnonymizeSaltFile string Debug bool Interval time.Duration LimitBytes int64 Rules []string RulesFile string Transformer metricfamily.Transformer Logger log.Logger Tracer trace.TracerProvider }
Config defines the parameters that can be used to configure a worker. The only required field is `From`.
type RuleMatcher ¶
type RuleMatcher interface {
MatchRules() []string
}
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker represents a metrics forwarding agent. It collects metrics from a source URL and forwards them to a sink. A Worker should be configured with a `Config` and instantiated with the `New` func. Workers are thread safe; all access to shared fields are synchronized.
func New ¶
New creates a new Worker based on the provided Config. If the Config contains invalid values, then an error is returned.
func (*Worker) LastMetrics ¶
func (w *Worker) LastMetrics() []*clientmodel.MetricFamily
func (*Worker) Reconfigure ¶
Reconfigure temporarily stops a worker and reconfigures is with the provided Config. Is thread safe and can run concurrently with `LastMetrics` and `Run`.