cloudprober: github.com/google/cloudprober/probes/options Index | Files

package options

import "github.com/google/cloudprober/probes/options"

Package options provides a shared interface to common probe options.

Index

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
    TargetLabel
    TargetName
)

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.