Documentation ¶
Overview ¶
Package options provides a shared interface to common probe options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalLabel ¶ added in v0.10.5
type AdditionalLabel struct { Key string // contains filtered or unexported fields }
AdditionalLabel encapsulates additional labels to attach to probe results.
func ParseAdditionalLabel ¶ added in v0.11.4
func ParseAdditionalLabel(alpb *configpb.AdditionalLabel) *AdditionalLabel
ParseAdditionalLabel parses an additional label proto message into an AdditionalLabel struct.
func (*AdditionalLabel) KeyValueForTarget ¶ added in v0.10.5
func (al *AdditionalLabel) KeyValueForTarget(ep endpoint.Endpoint) (key, val string)
KeyValueForTarget returns key, value pair for the given target.
func (*AdditionalLabel) UpdateForTarget ¶ added in v0.10.5
func (al *AdditionalLabel) UpdateForTarget(ep endpoint.Endpoint, ipAddr string, probePort int)
UpdateForTarget updates addtional label based on target's name and labels.
type Options ¶
type Options struct { Targets targets.Targets Interval, Timeout time.Duration Logger *logger.Logger ProbeConf interface{} // Probe-type specific config LatencyDist *metrics.Distribution LatencyUnit time.Duration LatencyMetricName string Validators []*validators.Validator SourceIP net.IP IPVersion int StatsExportInterval time.Duration LogMetrics func(*metrics.EventMetrics) AdditionalLabels []*AdditionalLabel Schedule *Schedule NegativeTest bool AlertHandlers []*alerting.AlertHandler }
Options encapsulates common probe options.
func BuildProbeOptions ¶ added in v0.10.2
func BuildProbeOptions(p *configpb.ProbeDef, ldLister endpoint.Lister, globalTargetsOpts *targetspb.GlobalTargetsOptions, l *logger.Logger) (*Options, error)
BuildProbeOptions builds probe's options using the provided config and some global params.
func DefaultOptions ¶ added in v0.11.4
func DefaultOptions() *Options
DefaultOptions returns default options, capturing default values for the various fields.
func (*Options) IsScheduled ¶ added in v0.13.3
func (*Options) RecordMetrics ¶ added in v0.13.0
func (opts *Options) RecordMetrics(ep endpoint.Endpoint, em *metrics.EventMetrics, dataChan chan<- *metrics.EventMetrics, ropts ...RecordOptions)
type RecordOptions ¶ added in v0.13.0
type RecordOptions func(*recordOptions)
func WithNoAlert ¶ added in v0.13.0
func WithNoAlert() RecordOptions
Click to show internal directories.
Click to hide internal directories.