cloudprober: Index | Files

package options

import ""

Package options provides a shared interface to common probe options.


Package Files

labels.go options.go

type AdditionalLabel Uses

type AdditionalLabel struct {
    Key string

    Value           string // static value
    TargetLabelKey  string // from target
    TargetLabelType TargetLabelType

    // This map will allow for quick label lookup for a target. It will be
    // updated by the probe while updating targets.
    LabelForTarget map[string]string
    // contains filtered or unexported fields

AdditionalLabel encapsulates additional labels to attach to probe results.

func (*AdditionalLabel) KeyValueForTarget Uses

func (al *AdditionalLabel) KeyValueForTarget(targetName string) (key, val string)

KeyValueForTarget returns key, value pair for the given target.

func (*AdditionalLabel) UpdateForTarget Uses

func (al *AdditionalLabel) UpdateForTarget(tname string, tLabels map[string]string)

UpdateForTarget updates target-based label's value.

type Options Uses

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
    Validators          []*validators.Validator
    SourceIP            net.IP
    IPVersion           int
    StatsExportInterval time.Duration
    LogMetrics          func(*metrics.EventMetrics)
    AdditionalLabels    []*AdditionalLabel

Options encapsulates common probe options.

func BuildProbeOptions Uses

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 Uses

func DefaultOptions() *Options

DefaultOptions returns default options, capturing default values for the various fields.

type TargetLabelType Uses

type TargetLabelType int

TargetLabelType for target based additional labels

const (
    NotTargetLabel TargetLabelType = iota

TargetLabelType enum values.

Package options imports 14 packages (graph) and is imported by 39 packages. Updated 2020-10-22. Refresh now. Tools for package owners.